public override void OnEnable() { base.OnEnable(); Sents.Clear(); ChangeRelationShipCD.Clear(); Provocative.Clear(); }
public override void OnGameLogicTurn() { base.OnGameLogicTurn(); //调整关系 foreach (var item in ChangeRelationShipCD) { item.Value.Update(); } //挑衅 List <TUnit> clearProvocative = new List <TUnit>(); foreach (var item in Provocative) { item.Value.Update(); if (item.Value.IsOver()) { clearProvocative.Add(item.Key); } } foreach (var item in clearProvocative) { Provocative.Remove(item); } Sents.Clear(); CalcNeighbor(); }
protected List <string> GetSentDB() { List <string> ret = new List <string>(); Sents.ForEach(x => ret.Add(x.TDID)); return(ret); }
protected void LoadSent(List <string> db) { if (db == null) { return; } Sents.Clear(); db.ForEach(x => Sents.Add(GetEntity <TUnit>(x))); }
public int CalcSumPos() { var result = Sents.Sum(sent => sent.SumPos); foreach (var child in Children) { result += child.CalcSumPos(); } return(result); }
public bool IsSent(TUnit other) { if (other == null) { return(false); } if (SelfBaseUnit == other) { return(false); } return(Sents.Contains(other)); }
public void AddSent(TUnit other) { Sents.Add(other); }