Esempio n. 1
0
    //Processing
    public static void CreateZone(Vector3 _sp, Vector3 _ep, byte ZoneType, byte StorageType = 0)
    {
        Vector3 _StartPoint, _EndPoint;

        Functions.OrderVectors(_sp, _ep, out _StartPoint, out _EndPoint);
        switch (ZoneType)
        {
        case 0:
            Log.Notice(scr, "ZoneTypeIsMissing");
            break;

        case 1:
            AllStorages.Add(new Storage(_StartPoint, _EndPoint));
            break;

        case 2:
            AllFields.Add(new Field(_StartPoint, _EndPoint));
            break;

        case 3:
            AllPastures.Add(new Pasture(_StartPoint, _EndPoint));
            break;

        case 4:
            AllMines.Add(new Mine(_StartPoint, _EndPoint));
            AllMines[AllMines.Count - 1].HighlightAll();
            break;

        case 5:
            AllGatherings.Add(new Gathering(_StartPoint, _EndPoint));
            AllGatherings[AllGatherings.Count - 1].HighlightAll();
            break;

        default:
            Log.Notice(scr, "Zone type " + ZoneType + " undefined");
            break;
        }
    }
Esempio n. 2
0
 public static Mine GetMine(string Name)
 {
     return(AllMines.Find(x => x.Name == Name));
 }
Esempio n. 3
0
 public static Zone GetZone(ushort ID)
 {
     return((new List <Zone> {
         AllMines.Find(x => x.ID == ID), AllPastures.Find(x => x.ID == ID), AllStorages.Find(x => x.ID == ID), AllFields.Find(x => x.ID == ID)
     }).Find(x => x != null));
 }
Esempio n. 4
0
 public static Mine GetMine(ushort ID)
 {
     return(AllMines.Find(x => x.ID == ID));
 }