public void ExchangeFabric(Fabric oldFabric, Fabric newFabric) { int oldFaricIndex = GetIndex(oldFabric); if (HasFabric(oldFaricIndex)) { Fabrics[oldFaricIndex] = newFabric; } }
public void RemoveFabric(Fabric fab) { int index = GetIndex(fab); if (HasFabric(index)) { Fabrics[index] = null; } }
public int GetIndex(Fabric fabric) { for (int i = 0; i < Fabrics.Length; i++) { if (Fabrics[i] == fabric) { return(i); } } return(-1); }
public Director() { //start kit Bank = null; Materials = 4; Product = 2; Money = 10000; _bankrupt = false; Fabrics = new Fabric[6]; _fab_fix_costs = 0; for (int i = 0; i < 2; i++) { Fabrics[i] = new SimpleFabric(this, 0); } UpdateFabCosts(); }