public void Init(CMap map) { this._combatData.Map = map; this._combatData.LParties = map.GetLParties(); this._combatData.RParties = map.GetRParties(); foreach (var party in this._combatData.LParties) { this._combatData.Characters.AddRange(party.GetChars()); } foreach (var party in this._combatData.RParties) { this._combatData.Characters.AddRange(party.GetChars()); } if (this._combatData.Characters.Count > 0) { this._combatData.Characters.Sort( (x, y) => y.Proxy.GetStat(ESecondaryStat.Initiative) .CompareTo(x.Proxy.GetStat(ESecondaryStat.Initiative))); } foreach (var character in this._combatData.Characters) { this._combatData.InitiativeOrder.Add(character); } this.InitAI(map); this.ProcessTakingAction(); }
public void Init(CMap map, MapInitInfo info) { var builder = new PartyBuilder(); foreach (var partyInfo in info.LParties) { var party = builder.Build(partyInfo); party.SetAIControlled(partyInfo.AIControlled); map.GetLParties().Add(party); } foreach (var partyInfo in info.RParties) { var party = builder.Build(partyInfo); party.SetAIControlled(partyInfo.AIControlled); map.GetRParties().Add(party); } foreach (var party in map.GetLParties()) { foreach (var character in party.GetChars()) { character.Proxy.SetLParty(true); } } }
private void InitViews(CMap map, MapInitInfo info) { var builder = new CharViewBuilder(); foreach (var party in map.GetLParties()) { foreach (var c in party.GetChars()) { c.SetView(builder.Build(c.Proxy)); var tile = map.GetMap().GetTileForRow(c.Proxy.LParty, c.Proxy.StartCol); this.RenderChar(c, tile); } } foreach (var party in map.GetRParties()) { foreach (var c in party.GetChars()) { c.SetView(builder.Build(c.Proxy)); var tile = map.GetMap().GetTileForRow(c.Proxy.LParty, c.Proxy.StartCol); this.RenderChar(c, tile); } } }