Beispiel #1
0
        // Constructor for the control interface
        public ControlInterface(Color color, Worker w, string UP, string RIGHT, string DOWN, string LEFT, string PUT_LIQUID)
        {
            this.id     = color;
            this.worker = w;
            w.SetOwner(this);

            this.UP         = UP;
            this.RIGHT      = RIGHT;
            this.DOWN       = DOWN;
            this.LEFT       = LEFT;
            this.PUT_LIQUID = PUT_LIQUID;
        }
Beispiel #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);
        }