ELEC2645 (2018/19) / Mbed 2 deprecated el17ntkv

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

ScreenArray Class Reference

ScreenArray Class Reference

ScreenArray Class. More...

#include <ScreenArray.h>

Public Member Functions

 ScreenArray ()
 ScreenArray object donstructor.
 ~ScreenArray ()
 ScreenArray object destructor.
void init ()
 Mutator method initialises the screenarray object by filling the integer array with zeros.
int get (int x, int y)
 //Accessor method returns the value of the element at the array poisiton denoted by the x and y coordinates(columns and rows value) passed as the method parameter
void set (int x, int y, int type)
 Mutator method sets the array element at the position denoted by the x and y coordinates(columns and rows value) to the type(integer value) passed as the method's parameters.
void setRange (int x, int y, int width, int height, int type)
 //Mutator method sets all the elements within the region of elements within the screen array to the type passed as the method parameter call

Detailed Description

ScreenArray Class.

Author:
Mr Nigel TK Vere, University of Leeds ScreenArray class used for collision detection and score detection within the badman game
Date:
April 2019ScreenArray Class

ScreenArray class used for collision detection and score detection within the badman game

Version:
1.0
Author:
Mr Nigel TK Vere
Date:
April 2019

Definition at line 27 of file ScreenArray.h.


Constructor & Destructor Documentation

ScreenArray (  )

ScreenArray object donstructor.

Definition at line 4 of file ScreenArray.cpp.

~ScreenArray (  )

ScreenArray object destructor.

Definition at line 7 of file ScreenArray.cpp.


Member Function Documentation

int get ( int  x,
int  y 
)

//Accessor method returns the value of the element at the array poisiton denoted by the x and y coordinates(columns and rows value) passed as the method parameter

Parameters:
xX coordinate value of the screen position whose value we wish to retrieve
yY coordinate value of the screen position whose value we wish to retrieve

Definition at line 25 of file ScreenArray.cpp.

void init (  )

Mutator method initialises the screenarray object by filling the integer array with zeros.

Definition at line 12 of file ScreenArray.cpp.

void set ( int  x,
int  y,
int  type 
)

Mutator method sets the array element at the position denoted by the x and y coordinates(columns and rows value) to the type(integer value) passed as the method's parameters.

Parameters:
xInteger X coordinate value of the screen position whose value we wish to alter
yInteger Y coordinate value of the screen position whose value we wish to alter
typeInteger value denoting the type of object at this point in the grid

Definition at line 32 of file ScreenArray.cpp.

void setRange ( int  x,
int  y,
int  width,
int  height,
int  type 
)

//Mutator method sets all the elements within the region of elements within the screen array to the type passed as the method parameter call

Parameters:
xInteger X coordinate value of the screen position whose value we wish to alter
yInteger Y coordinate value of the screen position whose value we wish to alter
widthInteger value denoting the width of the screen array region that needs to be altered
heightInteger value denoting the height of the screen array region that needs to be altered
typeInteger value denoting the type of object at this point in the grid

Definition at line 39 of file ScreenArray.cpp.