Exemple #1
0
 /// <summary>
 ///     returns true if we have enough mana to create
 ///     the given obj. This method takes into consideration mana reserving.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool HasManaFor(CreatableObject obj) => obj.GetCost() <= GameState.CurrentMana;
Exemple #2
0
 /// <summary>
 ///     reserves the mana that is needed to build the given building
 /// </summary>
 /// <param name="obj"></param>
 public static void SaveManaFor(CreatableObject obj) => GameState.ReservedMana += obj.GetCost();