mirror of
https://github.com/islehorse/HISP.git
synced 2025-07-20 14:01:31 +12:00
Change default intrest rate,
and start adding ranches
This commit is contained in:
parent
02876ec2b4
commit
81440b1814
7 changed files with 1208 additions and 18 deletions
59
Horse Isle Server/HorseIsleServer/Game/Ranch.cs
Normal file
59
Horse Isle Server/HorseIsleServer/Game/Ranch.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue