public ChestMapEntity(MapEntityData data, Vector2 position, List<Item> items)
            : base(data, position)
        {
            inv = new InventoryContainer(this);

            this.data = data;

            foreach (Item i in items)
                inv.AddNonEquippable(i);
        }
 public CollidableMapEntity(MapEntityData mapEntityData, Vector2 position)
     : base(mapEntityData, position)
 {
     if (mapEntityData.Sprite != null)
     {
         this.boundingBox = mapEntityData.Sprite.Bounds;                         //the bounding box can be set to (temporarily, at least) the sprite bounding rectangle
         this.boundingBox.Location = new Point((int)position.X, (int)position.Y);//then need to move to the actual position, since the sprite is technically at (0, 0)
     }
     else
     {
         this.boundingBox = new Rectangle();
     }
 }
Ejemplo n.º 3
0
 public MapEntity(MapEntityData mapEntityData, Vector2 position)
 {
     this.mapEntityData = mapEntityData;
     this.Position = position;
 }
 private MapEntityData CreateMapEntityData(Texture2D texture)
 {
     MapEntityData data = new MapEntityData();
     data.Sprite = texture;
     return data;
 }