mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 13:15:53 +12:00
fix building
This commit is contained in:
parent
e169303b2c
commit
93829b1484
3 changed files with 61 additions and 14 deletions
|
@ -5,16 +5,42 @@ namespace HISP.Game
|
|||
{
|
||||
public class Ranch
|
||||
{
|
||||
public class RanchBuilding
|
||||
public class RanchUpgrade
|
||||
{
|
||||
public static List<RanchBuilding> RanchBuildings = new List<RanchBuilding>();
|
||||
public static List<RanchUpgrade> RanchUpgrades = new List<RanchUpgrade>();
|
||||
public int Id;
|
||||
public string Type;
|
||||
public int Cost;
|
||||
public string Title;
|
||||
public string Description;
|
||||
public int Limit;
|
||||
|
||||
public static bool RanchUpgradeExists(int id)
|
||||
{
|
||||
foreach (RanchUpgrade rachUpgrade in RanchUpgrades)
|
||||
{
|
||||
if (rachUpgrade.Id == id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static RanchUpgrade GetRanchUpgradeById(int id)
|
||||
{
|
||||
foreach (RanchUpgrade rachUpgrade in RanchUpgrades)
|
||||
{
|
||||
if (rachUpgrade.Id == id)
|
||||
return rachUpgrade;
|
||||
}
|
||||
throw new KeyNotFoundException("No ranch found.");
|
||||
}
|
||||
}
|
||||
public class RanchBuilding
|
||||
{
|
||||
public static List<RanchBuilding> RanchBuildings = new List<RanchBuilding>();
|
||||
public int Id;
|
||||
public int Cost;
|
||||
public string Title;
|
||||
public string Description;
|
||||
|
||||
public static bool RanchBuildingExists(int id)
|
||||
{
|
||||
foreach (RanchBuilding ranchBuilding in RanchBuildings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue