public override void Initialize() { _current = new Player(_currentName, Map.Generate()); _current.Map.SetPosition(GameDatas.WindowWidth/2 - GameDatas.Theme.GridSize, GameDatas.WindowHeight - GameDatas.Theme.GridSize - 25); SendCurrentPlayer(); }
public void ManageNetworkEvents(NetworkEvent eventDatas) { switch (eventDatas.PacketOpCode) { case 1: var basicsDatas = eventDatas as BasicsDatasEvent; _enemy = new Player(basicsDatas.Enemy, basicsDatas.EnemyMap); _enemy.Map.SetPosition(GameDatas.WindowWidth/2, GameDatas.WindowHeight - GameDatas.Theme.GridSize - 25); return; case 2: var fireDatas = eventDatas as FireDatasEvent; if (_current.Play(fireDatas.Coordinates.X, fireDatas.Coordinates.Y) == FireResult.Fail) _myTurn = true; break; } }