예제 #1
0
 // 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;
     }
 }
예제 #2
0
        // 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);
        }
예제 #3
0
 // Adds the given control interface to the player
 public void AddControl(ControlInterface controlInterface)
 {
     this.controlInterface = controlInterface;
 }