Beispiel #1
0
        public override Item getOne()
        {
            BlankObject BlankObject = new BlankObject(this.tileLocation, 0, 0);

            /*
             * drawPosition = this.drawPosition;
             * defaultBoundingBox = this.defaultBoundingBox;
             * boundingBox = this.boundingBox;
             * currentRotation = this.currentRotation - 1;
             * rotations = this.rotations;
             * rotate();
             */
            return(BlankObject);
        }
Beispiel #2
0
        public override bool canBePlacedHere(GameLocation l, Vector2 tile)
        {
            if ((l is FarmHouse))
            {
                for (int i = 0; i < this.boundingBox.Width / Game1.tileSize; i++)
                {
                    for (int j = 0; j < this.boundingBox.Height / Game1.tileSize; j++)
                    {
                        Vector2 vector = tile * (float)Game1.tileSize + new Vector2((float)i, (float)j) * (float)Game1.tileSize;
                        vector.X += (float)(Game1.tileSize / 2);
                        vector.Y += (float)(Game1.tileSize / 2);
                        foreach (KeyValuePair <Vector2, StardewValley.Object> something in l.objects)
                        {
                            StardewValley.Object obj = something.Value;
                            if ((obj.GetType()).ToString().Contains("BlankObject"))
                            {
                                BlankObject current = (BlankObject)obj;
                                if (current.Decoration_type == 11 && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y) && current.heldObject == null && this.getTilesWide() == 1)
                                {
                                    bool result = true;
                                    return(result);
                                }
                                if ((current.Decoration_type != 12 || this.Decoration_type == 12) && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y))
                                {
                                    bool result = false;
                                    return(result);
                                }
                            }
                        }
                    }
                }
                return(base.canBePlacedHere(l, tile));
            }
            else
            {
                // Game1.showRedMessage("NOT FARMHOUSE");
                for (int i = 0; i < this.boundingBox.Width / Game1.tileSize; i++)
                {
                    for (int j = 0; j < this.boundingBox.Height / Game1.tileSize; j++)
                    {
                        Vector2 vector = tile * (float)Game1.tileSize + new Vector2((float)i, (float)j) * (float)Game1.tileSize;
                        vector.X += (float)(Game1.tileSize / 2);
                        vector.Y += (float)(Game1.tileSize / 2);

                        /*
                         * foreach (BlankObject current in (l as FarmHouse).BlankObject)
                         * {
                         *  if (current.Decoration_type == 11 && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y) && current.heldObject == null && this.getTilesWide() == 1)
                         *  {
                         *      bool result = true;
                         *      return result;
                         *  }
                         *  if ((current.Decoration_type != 12 || this.Decoration_type == 12) && current.getBoundingBox(current.tileLocation).Contains((int)vector.X, (int)vector.Y))
                         *  {
                         *      bool result = false;
                         *      return result;
                         *  }
                         * }
                         */
                    }
                }
                return(base.canBePlacedHere(l, tile));
            }
        }