Exemplo n.º 1
0
        public override bool PutMoveAbleObjectOnThisField(MoveAbleObject obj, Game game)
        {
            if (obj != null && this.MoveAbleObject == null && this.Next != null)
            {
                this.MoveAbleObject     = obj;
                this.MoveAbleObject.Pos = this.Pos;
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public override void Action(Game _game)
        {
            LinkedList <Field> list = _game.getGameField();

            _ship = list.ElementAt(8).MoveAbleObject;

            if (_ship != null && this.MoveAbleObject != null && ((Ship)_ship).IsAtDock())
            {
                ((Ship)_ship).AddGoldToShip();
            }
        }
Exemplo n.º 3
0
        public override bool PutMoveAbleObjectOnThisField(MoveAbleObject obj, Game game)
        {
            if (this.direction == Directions.Up && this.Pos < obj.Pos ||
                this.direction == Directions.Down && this.Pos > obj.Pos)
            {
                this.MoveAbleObject     = obj;
                this.MoveAbleObject.Pos = this.Pos;
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        override public bool PutMoveAbleObjectOnThisField(MoveAbleObject obj, Game game)
        {
            if (obj != null && this.MoveAbleObject == null)
            {
                this.MoveAbleObject     = obj;
                this.MoveAbleObject.Pos = this.Pos;
                return(true);
            }
            else
            {
                // Cart found!
                // Gameover
                game.setGameOver();
            }

            return(false);
        }
Exemplo n.º 5
0
 public abstract bool PutMoveAbleObjectOnThisField(MoveAbleObject obj, Game game);