mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-10 07:05:41 +12:00
59 lines
1.5 KiB
C#
59 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HISP.Game
|
|
{
|
|
public class Ranch
|
|
{
|
|
public class RanchBuilding
|
|
{
|
|
public static List<RanchBuilding> RanchBuildings = new List<RanchBuilding>();
|
|
public int Id;
|
|
public string Type;
|
|
public int Cost;
|
|
public string Title;
|
|
public string Description;
|
|
public int Limit;
|
|
}
|
|
public static List<Ranch> Ranches = new List<Ranch>();
|
|
|
|
public int X;
|
|
public int Y;
|
|
public int Id;
|
|
public int Value;
|
|
|
|
public int OwnerId;
|
|
public int Upgraded;
|
|
public Ranch(int x, int y, int id, int value)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Id = id;
|
|
Value = value;
|
|
Upgraded = 0;
|
|
OwnerId = -1;
|
|
}
|
|
|
|
public static bool IsRanchHere(int x, int y)
|
|
{
|
|
foreach (Ranch ranch in Ranches)
|
|
{
|
|
if (ranch.X == x && ranch.Y == y)
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
public static Ranch GetRanchAt(int x, int y)
|
|
{
|
|
foreach(Ranch ranch in Ranches)
|
|
{
|
|
if (ranch.X == x && ranch.Y == y)
|
|
return ranch;
|
|
}
|
|
throw new KeyNotFoundException("No Ranch found at x" + x + " y" + y);
|
|
}
|
|
}
|
|
}
|