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); }
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 }); } }