Allows the player to fire a single shot at the playing field.

Namespace:  SoftwareArchitects.Battleships
Assembly:  SoftwareArchitects.Battleships (in SoftwareArchitects.Battleships.dll)
Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public abstract void Move(
	PlayingField playingField
)
Visual Basic (Declaration)
Public MustOverride Sub Move ( _
	playingField As PlayingField _
)
Visual C++
public:
virtual void Move(
	PlayingField^ playingField
) abstract

Parameters

playingField
Type: SoftwareArchitects.Battleships..::.PlayingField
The playingfield to fire at.

Remarks

Because of security reasons the execution of the method must not take more than 0.5 seconds. After that period of time the method is terminated automatically and the opponent is declared the winner.

Examples

The following example shows a very simple implementation of the move method. You can see the complete implementation of this player in Player.
CopyC#
public override void Move(PlayingField playingField)
{
    playingField.Fire(x, y);
    if (x + 1 >= playingField.Size)
    {
        x = 0;
        y++;
    }
    else
    {
        x++;
    }
}

See Also