Пример #1
0
 public void Clear()
 {
     BattleInfo?.Clear();
     BattleInfo = null;
     MechaInfoDict.Clear();
     PlayerMechaInfo = null;
 }
Пример #2
0
        public void StartBattle(BattleInfo battleInfo)
        {
            Clear();
            BattleInfo = battleInfo;
            BattleInfo.OnRemoveMechaInfoSuc = RemoveMechaInfo;

            PlayerMechaInfo = battleInfo.BattleMechaInfoData.PlayerMechaInfo;
            battleInfo.SetPlayerMecha(PlayerMechaInfo);
            foreach (KeyValuePair <uint, MechaInfo> kv in battleInfo.BattleMechaInfoData.EnemyMechaInfoDict)
            {
                AddEnemyMecha(kv.Value);
            }
        }
Пример #3
0
 public void RemoveEnemyMechaInfo(MechaInfo mechaInfo)
 {
     BattleMechaInfoData.EnemyMechaInfoDict.Remove(mechaInfo.GUID);
     OnRemoveMechaInfoSuc?.Invoke(mechaInfo);
 }
Пример #4
0
 public void AddEnemyMechaInfo(MechaInfo mechaInfo)
 {
     mechaInfo.OnRemoveMechaInfoSuc += RemoveEnemyMechaInfo;
     BattleMechaInfoData.EnemyMechaInfoDict.Add(mechaInfo.GUID, mechaInfo);
     OnAddMechaInfoSuc?.Invoke(mechaInfo);
 }
Пример #5
0
 public void SetPlayerMecha(MechaInfo mechaInfo)
 {
     BattleMechaInfoData.PlayerMechaInfo = mechaInfo;
     OnAddMechaInfoSuc?.Invoke(mechaInfo);
 }
Пример #6
0
 public BattleInfo(MechaInfo playerMechaInfo)
 {
     BattleMechaInfoData.PlayerMechaInfo = playerMechaInfo;
 }
Пример #7
0
 public bool IsFriend(MechaInfo mechaInfo)
 {
     return(IsFriend(mechaInfo.MechaCamp));
 }
Пример #8
0
 public bool IsOpponent(MechaInfo mechaInfo)
 {
     return(IsOpponent(mechaInfo.MechaCamp));
 }
Пример #9
0
 private void RemoveMechaInfo(MechaInfo mechaInfo)
 {
     MechaInfoDict.Remove(mechaInfo.GUID);
 }
Пример #10
0
 public void AddEnemyMecha(MechaInfo mechaInfo)
 {
     MechaInfoDict.Add(mechaInfo.GUID, mechaInfo);
     BattleInfo.AddEnemyMechaInfo(mechaInfo);
 }