// Sets an owner for the worker, Gets the control interface as a parameter public void SetOwner(ControlInterface controlInterface) { if (this.owner == null) { this.owner = controlInterface; } }
// Creates a new control interface public ControlInterface createControlInterface(Color c, string up, string right, string down, string left, string AddLiquid) { Worker w = new Worker(spawnPlaces[spawnedCount][2]); foreach (Field f in fields) { if ((spawnPlaces[spawnedCount][0] == f.coordX) && (spawnPlaces[spawnedCount][1] == f.coordY)) { f.AddMoveable(w); } } // Add this worker to a (possibly random) field here -- not sure about this, gotta ask Akos ControlInterface ci = new ControlInterface(c, w, up, right, down, left, AddLiquid); controlInterfaces.Add(ci); w.SetOwner(ci); spawnedCount++; return(ci); }
// Adds the given control interface to the player public void AddControl(ControlInterface controlInterface) { this.controlInterface = controlInterface; }