Example #1
0
        public void InitializeCharacters(string playerId, TeamData teamData, bool isTestMode = false)
        {
            teamData.Characters.ForEach(character =>
            {
                var cloneCharacter = Convert.Clone(character);
                cloneCharacter.InitializeDeckForBattle();
                cloneCharacter.ResetTurn();

                if (isTestMode)
                {
                    cloneCharacter.OwnerPlayerId = playerId;                        // Change player ID in test mode
                }
                Characters.Add(cloneCharacter);
            });

            var currentSide = Sides.Keys.Count == 0 ? CharacterSide.Spaghetti : CharacterSide.Unicorn;

            Sides.Add(playerId, currentSide);
        }