Beispiel #1
0
 public Character(CharacterStats characterStats, CharacterTypes.Type type, BattleEngine battleEngine)
 {
     CharacterStats = characterStats;
     CharacterStats.CharacterParent = this;
     Status             = CharacterTypes.Status.Alive;
     Type               = type;
     BattleEngine       = battleEngine;
     CharacterUiControl = AvatarSpotsManager.GetSpot(Type);
     CharacterSetup();
     CharacterUiControl.AssignCharactersToUi(this);
 }
 public static void FreeSpot(CharacterUi charAvater, CharacterTypes.Type type)
 {
     if (type == CharacterTypes.Type.Ally)
     {
         FreeSpotForList(charAvater, AvailableAllySpots);
     }
     else
     {
         FreeSpotForList(charAvater, AvailableAllySpots);
     }
 }
        private static void FreeSpotForList(CharacterUi charUi, List <Tuple <CharacterUi, bool> > list)
        {
            int index = list.FindIndex(pair => pair.Item1.Equals(charUi));

            list[index] = new Tuple <CharacterUi, bool>(charUi, true);
        }