public MovingItemAndMovingItemInteraction(World world, MovingItem movingItem1, MovingItem movingItem2)
        {
            if (world == null)
                throw new ArgumentNullException("world");
            if (movingItem1 == null)
                throw new ArgumentNullException("movingItem1");
            if (movingItem2 == null)
                throw new ArgumentNullException("movingItem2");
            if (movingItem1 is Shot)
                throw new ArgumentOutOfRangeException("movingItem1");
            if (movingItem2 is Shot)
                throw new ArgumentOutOfRangeException("movingItem2");

            this._world = world;
            var items = new[] {movingItem1, movingItem2};
            this._player = items.OfType<Player>().SingleOrDefault();
            this._boulder = items.OfType<Boulder>().SingleOrDefault();
            this._mine = items.OfType<Mine>().SingleOrDefault();
            this._monster1 = items.OfType<Monster.Monster>().FirstOrDefault();
            this._monster2 = items.OfType<Monster.Monster>().Skip(1).FirstOrDefault();

            this._moveableObject = items.FirstOrDefault(item => item.Solidity == ObjectSolidity.Moveable);
            this._insubstantialObject = items.FirstOrDefault(item => item.Solidity == ObjectSolidity.Insubstantial);
        }
Exemplo n.º 2
0
 public CookingState(Mine mine)
     : base(mine)
 {
     this.Mine.Ap.AnimationFinished += CookingFinished;
 }
Exemplo n.º 3
0
 public PrimedState(Mine mine)
     : base(mine)
 {
 }
Exemplo n.º 4
0
 protected MineState(Mine mine)
 {
     this.Mine = mine;
 }
Exemplo n.º 5
0
 public InactiveState(Mine mine)
     : base(mine)
 {
     this.Mine._countdown = TimeSpan.Zero;
 }
Exemplo n.º 6
0
 public FiredState(Mine mine)
     : base(mine)
 {
     this.Mine.World.Game.SoundPlayer.Play(GameSound.MonsterDies);
 }
Exemplo n.º 7
0
 public void AddMine(Vector2 position)
 {
     var m = new Mine(this, position);
     this.GameObjects.Add(m);
 }