mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 13:15:53 +12:00
Add Feature pt1
This commit is contained in:
parent
a184e4d735
commit
092534e331
131 changed files with 3113 additions and 1418 deletions
53
HorseIsleServer/LibHISP/Game/Services/Transport.cs
Normal file
53
HorseIsleServer/LibHISP/Game/Services/Transport.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
public class Transport
|
||||
{
|
||||
public struct TransportLocation
|
||||
{
|
||||
public int Id;
|
||||
public int Cost;
|
||||
public int GotoX;
|
||||
public int GotoY;
|
||||
public string Type;
|
||||
public string LocationTitle;
|
||||
}
|
||||
|
||||
public struct TransportPoint
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
public int[] Locations;
|
||||
}
|
||||
|
||||
public static List<TransportPoint> TransportPoints = new List<TransportPoint>();
|
||||
public static List<TransportLocation> TransportLocations = new List<TransportLocation>();
|
||||
|
||||
|
||||
public static TransportPoint GetTransportPoint(int x, int y)
|
||||
{
|
||||
foreach(TransportPoint transportPoint in TransportPoints)
|
||||
{
|
||||
if (transportPoint.X == x && transportPoint.Y == y)
|
||||
{
|
||||
return transportPoint;
|
||||
}
|
||||
}
|
||||
throw new KeyNotFoundException("Cannot find transport point at x:" + x + "y:" + y);
|
||||
}
|
||||
|
||||
public static TransportLocation GetTransportLocation(int id)
|
||||
{
|
||||
foreach (TransportLocation transportLocation in TransportLocations)
|
||||
{
|
||||
if (transportLocation.Id == id)
|
||||
{
|
||||
return transportLocation;
|
||||
}
|
||||
}
|
||||
throw new KeyNotFoundException("Cannot find transport location at Id:" + id);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue