C# Class SunsetHigh.Pickup

Pickup extends from Sprite, adding information for an Item attribute
Inheritance: Sprite
Mostrar archivo Open project: ErraticUnicorn/MOSH Class Usage Examples

Public Methods

Method Description
Pickup ( ) : System

Initializes a type-less Pickup at the origin which matches the dimensions of its sprite (when loaded)

Pickup ( int x, int y ) : System

Initializes a type-less Pickup at the given position which matches the dimensions of its sprite (when loaded)

Pickup ( int x, int y, System.Item type ) : System

Initializes a Pickup with a given Item type at the given position which matches the dimensions of its sprite (when loaded)

Pickup ( int x, int y, int width, int height ) : System

Initializes a type-less Pickup with the given position and dimensions

Pickup ( int x, int y, int width, int height, System.Item type ) : System

Initializes a Pickup with the given position, dimensions, and Item type

banish ( ) : void

Once the Pickup has been claimed, this method removes it from the screen

getItemType ( ) : System.Item
onCollide ( IInteractable other ) : void

We assume whenever the Hero collides with a pickup he picks it up.

setItemType ( System.Item type ) : void

Method Details

Pickup() public method

Initializes a type-less Pickup at the origin which matches the dimensions of its sprite (when loaded)
public Pickup ( ) : System
return System

Pickup() public method

Initializes a type-less Pickup at the given position which matches the dimensions of its sprite (when loaded)
public Pickup ( int x, int y ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
return System

Pickup() public method

Initializes a Pickup with a given Item type at the given position which matches the dimensions of its sprite (when loaded)
public Pickup ( int x, int y, System.Item type ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
type System.Item Item type of this Pickup
return System

Pickup() public method

Initializes a type-less Pickup with the given position and dimensions
public Pickup ( int x, int y, int width, int height ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
width int Width in pixels
height int Height in pixels
return System

Pickup() public method

Initializes a Pickup with the given position, dimensions, and Item type
public Pickup ( int x, int y, int width, int height, System.Item type ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
width int Width in pixels
height int Height in pixels
type System.Item Item type of this Pickup
return System

banish() public method

Once the Pickup has been claimed, this method removes it from the screen
public banish ( ) : void
return void

getItemType() public method

public getItemType ( ) : System.Item
return System.Item

onCollide() public method

We assume whenever the Hero collides with a pickup he picks it up.
public onCollide ( IInteractable other ) : void
other IInteractable
return void

setItemType() public method

public setItemType ( System.Item type ) : void
type System.Item
return void