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); }
public void AddTreasureToList(TreasureList list) { foreach (Treasure treasure in this.Treasures) { list.Add(treasure); } }
public void ReceiveTreasureList(TreasureList list) { foreach (Treasure treasure in list) { this.Treasures.Add(treasure); treasure.BelongedPerson = this; treasure.Influences.ApplyInfluence(this); } }
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; }
public TreasureList GetTreasureList() { TreasureList list = new TreasureList(); foreach (Person person in this.Persons) { if (person.TreasureCount > 0) { person.AddTreasureToList(list); } } return list; }
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; } }
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); } }