Exemplo n.º 1
0
 public void Remove_Workers(Building building)
 {
     if (Worked_By.Exists(x => x.Building == building))
     {
         Worked_By = Worked_By.Where(x => x.Building != building).ToList();
     }
 }
Exemplo n.º 2
0
    public bool Can_Work(Building building, Work_Type type)
    {
        if (!Worked_By.Exists(x => x.Building == building && x.Type == type))
        {
            return(false);
        }
        Building first = Worked_By.First(x => x.Type == type).Building;

        return(first.Id == building.Id);
    }
Exemplo n.º 3
0
 public void Add_Workers(Building building, Work_Type type)
 {
     if (!Worked_By.Exists(x => x.Building == building && x.Type == type))
     {
         Worked_By.Add(new WorkData()
         {
             Building = building, Type = type
         });
     }
 }
Exemplo n.º 4
0
 public TileSaveData Save_Data()
 {
     return(new TileSaveData()
     {
         X = X,
         Y = Y,
         Internal_Name = Internal_Name,
         Worked_By = Worked_By.Select(x => new WorkSaveData()
         {
             Id = x.Building.Id, Type = (int)x.Type
         }).ToList(),
         Minerals = Minerals.Select(x => new MineralSaveData()
         {
             Mineral = (int)x.Key, Amount = x.Value
         }).ToList(),
         Mineral_Spawns = Mineral_Spawns.Select(x => (int)x).ToList(),
         Water_Flow = Water_Flow.HasValue ? (int)Water_Flow : -1
     });
 }