Spaces:
Runtime error
Runtime error
File size: 1,064 Bytes
ce81a16 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
using System;
namespace Quantum
{
public unsafe class CommandSystem : SystemMainThread
{
public override void Update(Frame f)
{
var currentTurn = f.Global->CurrentTurn;
if (currentTurn.Status != TurnStatus.Active)
{
return;
}
var currentPlayer = f.Global->CurrentTurn.Player;
switch (f.GetPlayerCommand(currentPlayer))
{
case PlayCommand playCommand:
if (currentTurn.Type != TurnType.Play)
{
return;
}
f.Signals.OnPlayCommandReceived(currentPlayer, playCommand.Data);
f.Events.PlayCommandReceived(currentPlayer, playCommand.Data);
break;
case SkipCommand skipCommand:
var config = f.FindAsset<TurnConfig>(currentTurn.ConfigRef.Id);
if (!config.IsSkippable)
{
return;
}
f.Signals.OnSkipCommandReceived(currentPlayer, skipCommand.Data);
f.Events.SkipCommandReceived(currentPlayer, skipCommand.Data);
break;
}
}
}
} |