Ejemplo n.º 1
0
        public static bool RecipesMatch(CraftingGrid CG, CraftingRecipe CR)
        {
            for (int y = 0; y < 5; y++)
            {
                for (int x = 0; x < 5; x++)
                {
                    if (CR.RecipeParts[x, y] == null)
                    {
                        if (CG.GetStack(x, y) == null)
                        {
                            continue;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    if(!CR.RecipeParts[x, y].Match(CG.GetStack(x, y)))
                    {
                        return false;
                    }
                }
            }

            return true;
        }
Ejemplo n.º 2
0
        public CraftingTableTE(Vector2 Position, GameWorld GameWorld)
            : base(GameWorld, "CraftingTable")
        {
            this.Entity = new CraftingTableEntity(GameWorld);
            this.TileBlock = Block.GetBlock(1001);
            this.Name = "Textures/TileEntities/CraftingTable";

            Inventory = new TileEntityGUI(new Rectangle(GeneralManager.HalfWidth - 175 - 180, GeneralManager.HalfHeight - 146, 180, 180), Color.Transparent);

            GameWorld.ParentScreen.AddGUI(Inventory);
            CraftingGrid = new CraftingGrid(GameWorld, new Vector2(GeneralManager.HalfWidth - 175 - 180 + 5, GeneralManager.HalfHeight - 146 + 5));
            CraftingGrid.AddToInventory(Inventory);
        }