Beispiel #1
0
    public void OtherSourcesIncome(Enums.Material type, int count)
    {
        CityMaterial m = MaterialList.Find(x => x.GetMaterialType() == type);

        if (m == null)
        {
            MaterialList.Add(m = new CityMaterial(type));
        }
        m.UseMaterial(-count);
    }
Beispiel #2
0
    public bool TryToGetMaterial(Enums.Material type, int count)
    {
        CityMaterial m = MaterialList.Find(x => x.GetMaterialType() == type);

        if (m.GetCount() > count)
        {
            m.UseMaterial(count);
            return(true);
        }
        return(false);
    }
Beispiel #3
0
    public void OtherSourcesOutcome(Enums.Material type, int count)
    {
        CityMaterial m = MaterialList.Find(x => x.GetMaterialType() == type);

        if (m == null)
        {
            return;
        }
        if (m.GetCount() < count)
        {
            return;
        }
        m.UseMaterial(count);
    }
Beispiel #4
0
 public CityMaterial(Enums.Material type)
 {
     this.type = type;
     count     = 0;
 }
 public ProducedMaterial(Enums.Material type, int BaseProduction)
 {
     this.type           = type;
     Count               = 0;
     this.BaseProduction = BaseProduction;
 }