Ejemplo n.º 1
0
 public override void OnEnable()
 {
     base.OnEnable();
     Sents.Clear();
     ChangeRelationShipCD.Clear();
     Provocative.Clear();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
        protected List <string> GetSentDB()
        {
            List <string> ret = new List <string>();

            Sents.ForEach(x => ret.Add(x.TDID));
            return(ret);
        }
Ejemplo n.º 4
0
 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);
        }
Ejemplo n.º 6
0
 public bool IsSent(TUnit other)
 {
     if (other == null)
     {
         return(false);
     }
     if (SelfBaseUnit == other)
     {
         return(false);
     }
     return(Sents.Contains(other));
 }
Ejemplo n.º 7
0
 public void AddSent(TUnit other)
 {
     Sents.Add(other);
 }