예제 #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);
        }
예제 #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();
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #5
0
 public abstract bool PutMoveAbleObjectOnThisField(MoveAbleObject obj, Game game);