Example #1
0
        public void Spawn(Robot owner)
        {
            int item = rand.Next(3);

            Item newItem = null;

            switch (item)
            {
            case 0:
                // crowbar
                newItem = new Crowbar(itemTex, sourceDict["crowbar"]);
                break;

            case 1:
                // laserpistol
                newItem = new LaserPistol(itemTex, sourceDict["laserpistol"]);
                break;

            case 2:
                // axe
                newItem = new Axe(itemTex, sourceDict["axe"]);
                break;
            }

            newItem.Owner = owner;
            owner.Item    = newItem;
            Items.Add(newItem);
        }
Example #2
0
        public void Spawn(Robot owner)
        {
            int item = rand.Next(3);

            Item newItem = null;

            switch (item)
            {
                case 0:
                    // crowbar
                    newItem = new Crowbar(itemTex, sourceDict["crowbar"]);
                    break;
                case 1:
                    // laserpistol
                    newItem = new LaserPistol(itemTex, sourceDict["laserpistol"]);
                    break;
                case 2:
                    // axe
                    newItem = new Axe(itemTex, sourceDict["axe"]);
                    break;
            }

            newItem.Owner = owner;
            owner.Item = newItem;
            Items.Add(newItem);
        }