Example #1
0
        private void SyncDamageDeckSeed(PlayerNo playerNo, int seed)
        {
            if (ReplaysManager.Mode == ReplaysMode.Write)
            {
                JSONObject parameters = new JSONObject();
                parameters.AddField("player", playerNo.ToString());
                parameters.AddField("seed", seed.ToString());

                GameController.SendCommand(
                    GameCommandTypes.DamageDecksSync,
                    null,
                    parameters.ToString()
                    );

                Console.Write("Command is executed: " + GameCommandTypes.DamageDecksSync, LogTypes.GameCommands, true, "aqua");
                GameController.GetCommand().Execute();
            }
            else if (ReplaysManager.Mode == ReplaysMode.Read)
            {
                GameCommand command = GameController.GetCommand();

                if (command.Type == GameCommandTypes.DamageDecksSync)
                {
                    Console.Write("Command is executed: " + command.Type, LogTypes.GameCommands, true, "aqua");
                    command.Execute();
                }
            }
        }
Example #2
0
    public static GameCommand GenerateDeckShuffleCommand(PlayerNo playerNo, int seed)
    {
        JSONObject parameters = new JSONObject();

        parameters.AddField("player", playerNo.ToString());
        parameters.AddField("seed", seed.ToString());

        return(GameController.GenerateGameCommand(
                   GameCommandTypes.DamageDecksSync,
                   null,
                   parameters.ToString()
                   ));
    }