void OnNextTurn(CTurn turn) { if (turn is PlayerTurn) { _laserEmitter.Emit(this.ParentGrid, _dir); } }
void OnNextTurn(CTurn turn) { if (turn is PlayerTurn) { PassTurn(); } }
public override void OnStart(params object[] data) { base.OnStart(); _CurTurn = null; _TurnQuene = new Queue <CTurn>(); _TurnQuene.Enqueue(new PlayerTurn(this)); _TurnQuene.Enqueue(new StarredTurn(this)); _TurnQuene.Enqueue(new RobotTurn(this)); }
public void NextTurn() { if (_CurTurn != null) { _CurTurn.OnEndTurn(); _TurnQuene.Enqueue(_CurTurn); } _CurTurn = _TurnQuene.Dequeue(); Notifications?.Invoke(_CurTurn); _CurTurn.OnStartTurn(); }
public CTurn FindTurn(string turn_type_name) { CTurn turn = null; foreach (var t in _TurnQuene) { if (t.GetType().Name == turn_type_name) { turn = t; break; } } return(turn); }
public override void OnStop() { _CurTurn = null; base.OnStop(); }