Game-Design / Sprint3_actual / Items / MagicalBoomerangItem.cs
MagicalBoomerangItem.cs
Raw
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using System;
using System.Collections.Generic;
using System.Text;
using Sprint3_actual.ActiveItems;
using Sprint3_actual.StateFiles;

namespace Sprint3_actual
{
    class MagicalBoomerangItem : IStageItem
    {

        private ISprite MagicalBoomerangSprite;
        private Rectangle posRectangle;
        private bool removed;

        public bool hasActiveItem => true;
        public bool isStoreableItem => true;

        public MagicalBoomerangItem(int xPos, int yPos)
        {
            this.removed = false;
            this.posRectangle = new Rectangle(xPos, yPos, 5, 16);
            this.MagicalBoomerangSprite = ItemSpriteFactory.Instance.CreateMagicalBoomerangItem(this);

        }

        public void setPos(int destx, int desty)
        {
            posRectangle = new Rectangle(destx, desty, 5, 16);
            MagicalBoomerangSprite = ItemSpriteFactory.Instance.CreateMagicalBoomerangItem(this);
        }

        public Rectangle getPos()
        {
            return posRectangle;

        }

        public void DrawItem()
        {
            MagicalBoomerangSprite.draw();

        }

        public void UpdateItem(GameTime gameTime)
        {
            //MagicalBoomerangSprite.update(gameTime);

        }

        public void Collide()
        {
            removed = true;

        }

        public bool IsRemoved()
        {
            return removed;
        }

        public IActiveItem ReturnItem(ILink link, Game1 game)
        {
            return new MagicBoomerang(link, game);
        }
    }
}