示例#1
0
        public CraftPanel(CowGameScreen cowGameScreen) : base(cowGameScreen)
        {
            Containers       = new Container[2, 2];
            _drawPos         = new Vector2(920, 758);
            Containers[0, 0] = new StaticConainer(new Rectangle((int)_drawPos.X + 19, (int)_drawPos.Y + 20, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[0, 1] = new StaticConainer(new Rectangle((int)_drawPos.X + 75, (int)_drawPos.Y + 20, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[1, 0] = new StaticConainer(new Rectangle((int)_drawPos.X + 19, (int)_drawPos.Y + 71, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);
            Containers[1, 1] = new StaticConainer(new Rectangle((int)_drawPos.X + 75, (int)_drawPos.Y + 71, 42, 42), cowGameScreen.GameTextures["cleanTexture"]);

            CraftContainer = new CraftContainer(new Rectangle((int)_drawPos.X + 167, (int)_drawPos.Y + 45, 42, 42), cowGameScreen.GameTextures["cleanTexture"], this);
        }
示例#2
0
        public Inventory(CowGameScreen cowGameScreen)
        {
            _cowGameScreen = cowGameScreen;
            _typesIds      = ItemsTypesHelper.GetItemsTypes();
            _indexOnFocus  = 0;
            StartPosition  = new Vector2(330, 827);
            EndPosition    = new Vector2(StartPosition.X + _cowGameScreen.GameTextures["inventoryPanel"].Width, StartPosition.Y);

            _containersOnFocus     = new HashSet <Container>();
            _prevContainersOnFocus = new HashSet <Container>();

            var pos = new Vector2(StartPosition.X + 25, StartPosition.Y + 9);

            _containers = new StaticConainer[9];
            for (var i = 0; i < _containers.Length; i++)
            {
                var rect = new Rectangle((int)pos.X, (int)pos.Y, 42, 42);
                _containers[i] = new StaticConainer(rect, cowGameScreen.GameTextures["cleanTexture"]);
                pos.X         += 13 + rect.Width;
            }

            SwapContainer = new SwapContainer(Rectangle.Empty);
        }