Пример #1
0
 /// <summary>
 /// Set currentSubtype to the Subtype of the given id.
 /// If id equals - 1 restore to default.
 /// </summary>
 /// <param name="id">The id of the new currently selected Subtype</param>
 public void changeSubtype(int id)
 {
     if (id == -1)
     {
         currentSubtype = null;
     }
     else
     {
         currentSubtype = subtypes[id];
     }
 }
Пример #2
0
 /// <summary>
 /// Set currentType to the Type of the given id and updates the subtypes list.
 /// If id equals -1 restore to default.
 /// </summary>
 /// <param name="id">The id of the new currently selected Type</param>
 public void changeType(int id)
 {
     if (id == -1)
     {
         currentType    = null;
         currentSubtype = null;
         subtypes       = new List <Subtype>();
     }
     else
     {
         currentType = resources.getType(id);
         subtypes    = currentType.Subtypes;
     }
 }