C# Class BattleShip.casePlatform

Show file Open project: LucienCamuglia/Battleships Class Usage Examples

Public Methods

Method Description
DisplayCase ( Graphics g ) : void

create a case of a platform

DisplayCross ( Graphics g, int x, int y ) : void

display a red cross inside a case

IsBetweenCase ( int mouseX, int mouseY ) : bool

test if the cursor position is between a case

OverCase ( int x, int y ) : void

check if the mouse is over the case and display it

casePlatform ( int x, int y, int size, Color color ) : System

Private Methods

Method Description
ChangeRectLocation ( int x, int y ) : void

change the rectangle location if the case size has change

ChangeRectSize ( int size ) : void

change the size of the rectangle if the case size size has change

Method Details

DisplayCase() public method

create a case of a platform
public DisplayCase ( Graphics g ) : void
g System.Drawing.Graphics
return void

DisplayCross() public method

display a red cross inside a case
public DisplayCross ( Graphics g, int x, int y ) : void
g System.Drawing.Graphics
x int coordinate x of the case
y int coordinate y of the case
return void

IsBetweenCase() public method

test if the cursor position is between a case
public IsBetweenCase ( int mouseX, int mouseY ) : bool
mouseX int position x of the mouse cursor
mouseY int position y of the mouse cursor
return bool

OverCase() public method

check if the mouse is over the case and display it
public OverCase ( int x, int y ) : void
x int
y int
return void

casePlatform() public method

public casePlatform ( int x, int y, int size, Color color ) : System
x int
y int
size int
color Color
return System