示例#1
0
        private static Treasure HandleID()
        {
            Treasure r = new Treasure();

            //look for empty id
            int          id = 25000;
            TreasureList pl = Session.Current.Scenario.Treasures as TreasureList;

            pl.SmallToBig   = true;
            pl.IsNumber     = true;
            pl.PropertyName = "ID";
            pl.ReSort();
            foreach (Treasure p in pl)
            {
                if (p.ID == id)
                {
                    id++;
                }
                else if (p.ID > id)
                {
                    break;
                }
            }
            r.ID = id;
            return(r);
        }
示例#2
0
 public void AddTreasureToList(TreasureList list)
 {
     foreach (Treasure treasure in this.Treasures)
     {
         list.Add(treasure);
     }
 }
示例#3
0
 public void ReceiveTreasureList(TreasureList list)
 {
     foreach (Treasure treasure in list)
     {
         this.Treasures.Add(treasure);
         treasure.BelongedPerson = this;
         treasure.Influences.ApplyInfluence(this);
     }
 }
示例#4
0
 public void LoseTreasureList(TreasureList list)
 {
     foreach (Treasure treasure in list)
     {
         this.Treasures.Remove(treasure);
         treasure.Influences.PurifyInfluence(this);
         treasure.BelongedPerson = null;
     }
 }
 public TreasureList GetAllTreasureInFaction()
 {
     TreasureList list = new TreasureList();
     if (this.BelongedFaction != null)
     {
         foreach (Person person in this.BelongedFaction.Persons)
         {
             person.AddTreasureToList(list);
         }
     }
     return list;
 }
 public TreasureList GetTreasureListOfLeader()
 {
     TreasureList list = new TreasureList();
     if (this.BelongedFaction != null)
     {
         this.BelongedFaction.Leader.AddTreasureToList(list);
     }
     return list;
 }
 public TreasureList GetAllTreasureInArchitectureExceptLeader()
 {
     TreasureList list = new TreasureList();
     if (this.BelongedFaction != null)
     {
         foreach (Person person in this.Persons)
         {
             if (person != this.BelongedFaction.Leader)
             {
                 person.AddTreasureToList(list);
             }
         }
     }
     return list;
 }
 public TreasureList GetAllTreasureInArchitecture()
 {
     TreasureList list = new TreasureList();
     foreach (Person person in this.GetAllPersons())
     {
         person.AddTreasureToList(list);
     }
     return list;
 }
示例#9
0
 public TreasureList GetTreasureList()
 {
     TreasureList list = new TreasureList();
     foreach (Person person in this.Persons)
     {
         if (person.TreasureCount > 0)
         {
             person.AddTreasureToList(list);
         }
     }
     return list;
 }
示例#10
0
 public void LoseTreasureList(TreasureList list)
 {
     foreach (Treasure treasure in list)
     {
         this.Treasures.Remove(treasure);
         treasure.Influences.PurifyInfluence(this, GameObjects.Influences.Applier.Treasure, treasure.ID);
         treasure.BelongedPerson = null;
     }
 }
示例#11
0
 public void ReceiveTreasureList(TreasureList list)
 {
     foreach (Treasure treasure in list)
     {
         this.Treasures.Add(treasure);
         treasure.BelongedPerson = this;
         treasure.Influences.ApplyInfluence(this, GameObjects.Influences.Applier.Treasure, treasure.TreasureGroup);
     }
 }