コード例 #1
0
 public override void OnEnable()
 {
     base.OnEnable();
     Sents.Clear();
     ChangeRelationShipCD.Clear();
     Provocative.Clear();
 }
コード例 #2
0
        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();
        }
コード例 #3
0
        protected List <string> GetSentDB()
        {
            List <string> ret = new List <string>();

            Sents.ForEach(x => ret.Add(x.TDID));
            return(ret);
        }
コード例 #4
0
 protected void LoadSent(List <string> db)
 {
     if (db == null)
     {
         return;
     }
     Sents.Clear();
     db.ForEach(x => Sents.Add(GetEntity <TUnit>(x)));
 }
コード例 #5
0
        public int CalcSumPos()
        {
            var result = Sents.Sum(sent => sent.SumPos);

            foreach (var child in Children)
            {
                result += child.CalcSumPos();
            }

            return(result);
        }
コード例 #6
0
 public bool IsSent(TUnit other)
 {
     if (other == null)
     {
         return(false);
     }
     if (SelfBaseUnit == other)
     {
         return(false);
     }
     return(Sents.Contains(other));
 }
コード例 #7
0
 public void AddSent(TUnit other)
 {
     Sents.Add(other);
 }