private void UpdateGameState(CatanGame game, IGameUpdate update) { foreach (var player in game.Players) { Clients.Client(player.Player.ConnectionId.ToString()).update(update); } }
public static void Awake() { #region addManager s_ConfigManager = AddManager <ConfigManager>(); s_TimerManager = AddManager <TimerManager>(); s_UpdateRunManager = AddManager <UpdateRunManager>(); s_EventManager = AddManager <EventManager>(); s_ResourceManager = AddManager <ResourceManager>(); s_UpgradeManager = AddManager <UpgradeManager>(); s_ScriptManager = AddManager <ScriptManager>(); s_GameFlowManager = AddManager <GameFlowManager>(); #endregion foreach (var manager in m_ManagerList) { IGameUpdate gameUpdate = manager as IGameUpdate; if (gameUpdate != null) { m_UpdateList.Add(gameUpdate); } IGameFixedUpdate gameFixedUpdate = manager as IGameFixedUpdate; if (gameFixedUpdate != null) { m_FixedUpdateList.Add(gameFixedUpdate); } } foreach (var manager in m_ManagerList) { manager.Awake(); } }
public GameModelUpdateLogic(IGameUpdate gameUpdate, IGameParse gameParse, IGameTeamParse gameTeamParse, IGameTeamUpdate gameTeamUpdate) { _gameUpdate = gameUpdate; _gameParse = gameParse; _gameTeamParse = gameTeamParse; _gameTeamUpdate = gameTeamUpdate; }
public IGameCommand Decode(IGameUpdate gameUpdate) { //002x7000000-0040-0000-0000-000000005555x1000y7899 string commandData = gameUpdate.GameState.Substring(0, 3); //002 string playerIdData = gameUpdate.GameState.Substring(3, 36); //x7000000-0040-0000-0000-000000005555 string mainData = gameUpdate.GameState.Substring(39, gameUpdate.GameState.Length - 39); //10007899 GameCommands command = GetCommand(commandData); IGameCommand gameCommand = new GameCommand { Command = command, Data = ProcessData(command, playerIdData, mainData, gameUpdate.IPAddress) }; return(gameCommand); }
public void AddIGame(IGameUpdate update) { callOnCoreUpdate.Add(update); }