public void Clear() { BattleInfo?.Clear(); BattleInfo = null; MechaInfoDict.Clear(); PlayerMechaInfo = null; }
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); } }
public void RemoveEnemyMechaInfo(MechaInfo mechaInfo) { BattleMechaInfoData.EnemyMechaInfoDict.Remove(mechaInfo.GUID); OnRemoveMechaInfoSuc?.Invoke(mechaInfo); }
public void AddEnemyMechaInfo(MechaInfo mechaInfo) { mechaInfo.OnRemoveMechaInfoSuc += RemoveEnemyMechaInfo; BattleMechaInfoData.EnemyMechaInfoDict.Add(mechaInfo.GUID, mechaInfo); OnAddMechaInfoSuc?.Invoke(mechaInfo); }
public void SetPlayerMecha(MechaInfo mechaInfo) { BattleMechaInfoData.PlayerMechaInfo = mechaInfo; OnAddMechaInfoSuc?.Invoke(mechaInfo); }
public BattleInfo(MechaInfo playerMechaInfo) { BattleMechaInfoData.PlayerMechaInfo = playerMechaInfo; }
public bool IsFriend(MechaInfo mechaInfo) { return(IsFriend(mechaInfo.MechaCamp)); }
public bool IsOpponent(MechaInfo mechaInfo) { return(IsOpponent(mechaInfo.MechaCamp)); }
private void RemoveMechaInfo(MechaInfo mechaInfo) { MechaInfoDict.Remove(mechaInfo.GUID); }
public void AddEnemyMecha(MechaInfo mechaInfo) { MechaInfoDict.Add(mechaInfo.GUID, mechaInfo); BattleInfo.AddEnemyMechaInfo(mechaInfo); }