Beispiel #1
0
 public FriedMeat(RawMeat r)
 {
     r           = null;
     this.id     = (int)foods.FriedMeat;
     this.health = 35;
     this.name   = "Fried Meat";
     this.price  = 15;
 }
Beispiel #2
0
 public BoiledMeat(RawMeat r)
 {
     r            = null;
     this.product = 0;
     this.id      = ++id;
     this.health  = 20;
     this.name    = "Boiled Meat";
     this.price   = 12;
 }
Beispiel #3
0
        static void Main(string[] args)
        {
            {
                Unit        u       = new Unit(200, 200);
                RawMeat     meat    = new RawMeat(100, 100);
                CookFactory factory = new CookFactory(200, 300);
                global.gameojects.Add(u);
                global.gameojects.Add(meat);
                global.gameojects.Add(factory);
                global.gameojects.Add(new CookedMeat(200, 100));
                u.ActiveTask = new MoveItemToBuilding(meat, factory);
                u.ActiveTask = new GoToTask(30, 20);
            }
            game.Load += (sender, e) =>
            {
                game.VSync = VSyncMode.On;
            };

            game.Resize += (sender, e) =>
            {
                game.Height = game.Width * 2 / 3;
                GL.Viewport(0, 0, game.Width, game.Height);
            };
            game.KeyUp   += Game_KeyUp;
            game.Closing += (sender, e) => { global.isRuning = false; physic.Wait(); };
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Blend);
            game.RenderFrame += (sender, e) =>
            {
                GL.ClearColor(0, 1f, 0, 1f);
                GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

                GL.MatrixMode(MatrixMode.Projection);
                GL.LoadIdentity();
                GL.Ortho(0, global.WIDTH, global.HEIGHT, 0, 2.1, -2.1);
                foreach (GameObject gm in global.gameojects)
                {
                    gm.Draw();
                }
                game.SwapBuffers();
            };
            physic.Start();
            game.Run(60.0);
        }
Beispiel #4
0
 public Inventory()
 {
     list[0, 0] = new Apple();
     list[0, 1] = new RawMeat();
 }
Beispiel #5
0
        public static InventoryItem CreateInventoryItem(string key, TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics)
        {
            InventoryItem item          = null;
            int           amountStacked = 1;

            switch (key)
            {
            case ("tribalTokens"):
                item = new TribalTokens(team, region, location, content, graphics);
                break;

            case ("basePlank"):
                item = new BasePlank(team, region, location, content, graphics);
                break;

            case ("shortSword"):
                item = new ShortSword(team, region, location, content, graphics);
                break;

            case ("softWood"):
                item = new SoftWood(team, region, location, content, graphics);
                break;

            case ("islandGrass"):
                item = new IslandGrass(team, region, location, content, graphics);
                break;

            case ("coal"):
                item = new Coal(team, region, location, content, graphics);
                break;

            case ("ironOre"):
                item = new IronOre(team, region, location, content, graphics);
                break;

            case ("baseSword"):
                item = new BaseSword(team, region, location, content, graphics);
                break;

            case ("anvilItem"):
                item = new AnvilItem(team, region, location, content, graphics);
                item.placeableVersion = new CraftingAnvil(team, region, location, content, graphics);
                break;

            case ("baseChestItem"):
                item = new BaseChestItem(team, region, location, content, graphics);
                item.placeableVersion = new BaseChest(team, region, location, content, graphics);
                break;

            case ("nails"):
                item          = new Nails(team, region, location, content, graphics);
                amountStacked = 5;
                break;

            case ("cannonBallItem"):
                item          = new CannonBallItem(team, region, location, content, graphics);
                amountStacked = 3;
                break;

            case ("pistolShotItem"):
                item          = new PistolShotItem(team, region, location, content, graphics);
                amountStacked = 5;
                break;

            case ("ironBar"):
                item = new IronBar(team, region, location, content, graphics);
                break;

            case ("treasureMapItem"):
                item = new TreasureMapItem(null, team, region, location, content, graphics);
                break;

            case ("chiliFish"):
                item = new ChiliFish(team, region, location, content, graphics);
                break;

            case ("chiliPepper"):
                item = new ChiliPepper(team, region, location, content, graphics);
                break;

            case ("cookedFish"):
                item = new CookedFish(team, region, location, content, graphics);
                break;

            case ("cookedMeat"):
                item = new CookedMeat(team, region, location, content, graphics);
                break;

            case ("rawFish"):
                item = new RawFish(team, region, location, content, graphics);
                break;

            case ("rawMeat"):
                item = new RawMeat(team, region, location, content, graphics);
                break;

            case ("spoiledFish"):
                item = new SpoiledFish(team, region, location, content, graphics);
                break;

            case ("spoiledMeat"):
                item = new SpoiledMeat(team, region, location, content, graphics);
                break;

            case ("feather"):
                item = new Feather(team, region, location, content, graphics);
                break;

            case ("scales"):
                item = new Scales(team, region, location, content, graphics);
                break;

            case ("fishOil"):
                item = new FishOil(team, region, location, content, graphics);
                break;

            case ("goldCoins"):
                item = new GoldCoins(team, region, location, content, graphics);
                break;
            }
            item.itemKey       = key;
            item.amountStacked = amountStacked;
            return(item);
        }