C# 클래스 SunsetHigh.Character

Character extends from FreeMovingSprite, adding behavior for movement and inventory. Each character also has an Inventory (all his/her items).
상속: FreeMovingSprite
파일 보기 프로젝트 열기: ErraticUnicorn/MOSH 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
script Interaction

공개 메소드들

메소드 설명
Character ( ) : System

Initializes a default Character at the origin which matches the dimensions of its sprite (when loaded)

Character ( int x, int y ) : System

Initializes a Character at the given position which matches the dimensions of its sprite (when loaded)

Character ( int x, int y, int width, int height, string file ) : System

Initializes a Character at the given position with the given dimensions

bothFacing ( Character other ) : bool

Checks if two Characters are facing each other

facing ( IInteractable other ) : bool

Checks if this Character is facing another Interactable (e.g. other Character); used as a check for talking action

getClique ( ) : Clique
getDirection ( ) : Direction
getName ( ) : string
getOppositeDirection ( ) : Direction

Returns the reverse direction of this Character's current direction; used for making Characters face each other when talking

getPersonID ( ) : PersonID
inRange ( IInteractable other, int offset ) : bool

Checks in this Character is within a given range with another Interactable to perform any action. The range is another rectangle a given number of pixels thicker than the sprite's drawing rectangle. E.g. talk to another character, pickup an item, collision detection

inRangeAction ( IInteractable other ) : bool

Checks if this Character is in a given range to perform an action such as talking or pickpocketing

inRangeCollide ( IInteractable other ) : bool

Checks if this Character is in a given range for collisions

isFemale ( ) : bool
isMale ( ) : bool
move ( Direction dir, float elapsed, bool collide = true ) : bool
move ( float angle, float elapsed, bool collide = true ) : bool
onInteract ( ) : void
pickup ( Pickup p ) : void

Adds the given Pickup to this Character's inventory (and the Pickup disappears)

setClique ( Clique clique ) : void
setDirection ( Direction dir ) : void

Sets the direction of this Character and updates which row on the spritesheet to animate

setMale ( bool male ) : void
setName ( string name ) : void
setPersonID ( PersonID id ) : void
setScript ( string file ) : void

메소드 상세

Character() 공개 메소드

Initializes a default Character at the origin which matches the dimensions of its sprite (when loaded)
public Character ( ) : System
리턴 System

Character() 공개 메소드

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

Character() 공개 메소드

Initializes a Character at the given position with the given dimensions
public Character ( int x, int y, int width, int height, string file ) : 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
file string
리턴 System

bothFacing() 공개 메소드

Checks if two Characters are facing each other
public bothFacing ( Character other ) : bool
other Character The other Character
리턴 bool

facing() 공개 메소드

Checks if this Character is facing another Interactable (e.g. other Character); used as a check for talking action
public facing ( IInteractable other ) : bool
other IInteractable The other Interactable
리턴 bool

getClique() 공개 메소드

public getClique ( ) : Clique
리턴 Clique

getDirection() 공개 메소드

public getDirection ( ) : Direction
리턴 Direction

getName() 공개 메소드

public getName ( ) : string
리턴 string

getOppositeDirection() 공개 메소드

Returns the reverse direction of this Character's current direction; used for making Characters face each other when talking
public getOppositeDirection ( ) : Direction
리턴 Direction

getPersonID() 공개 메소드

public getPersonID ( ) : PersonID
리턴 PersonID

inRange() 공개 메소드

Checks in this Character is within a given range with another Interactable to perform any action. The range is another rectangle a given number of pixels thicker than the sprite's drawing rectangle. E.g. talk to another character, pickup an item, collision detection
public inRange ( IInteractable other, int offset ) : bool
other IInteractable The other Interactable to range check against
offset int The pixels offset for the range check
리턴 bool

inRangeAction() 공개 메소드

Checks if this Character is in a given range to perform an action such as talking or pickpocketing
public inRangeAction ( IInteractable other ) : bool
other IInteractable The other Sprite to range check against
리턴 bool

inRangeCollide() 공개 메소드

Checks if this Character is in a given range for collisions
public inRangeCollide ( IInteractable other ) : bool
other IInteractable The other Sprite to range check against
리턴 bool

isFemale() 공개 메소드

public isFemale ( ) : bool
리턴 bool

isMale() 공개 메소드

public isMale ( ) : bool
리턴 bool

move() 공개 메소드

public move ( Direction dir, float elapsed, bool collide = true ) : bool
dir Direction
elapsed float
collide bool
리턴 bool

move() 공개 메소드

public move ( float angle, float elapsed, bool collide = true ) : bool
angle float
elapsed float
collide bool
리턴 bool

onInteract() 공개 메소드

public onInteract ( ) : void
리턴 void

pickup() 공개 메소드

Adds the given Pickup to this Character's inventory (and the Pickup disappears)
public pickup ( Pickup p ) : void
p Pickup The Pickup to add
리턴 void

setClique() 공개 메소드

public setClique ( Clique clique ) : void
clique Clique
리턴 void

setDirection() 공개 메소드

Sets the direction of this Character and updates which row on the spritesheet to animate
public setDirection ( Direction dir ) : void
dir Direction Direction of this Character
리턴 void

setMale() 공개 메소드

public setMale ( bool male ) : void
male bool
리턴 void

setName() 공개 메소드

public setName ( string name ) : void
name string
리턴 void

setPersonID() 공개 메소드

public setPersonID ( PersonID id ) : void
id PersonID
리턴 void

setScript() 공개 메소드

public setScript ( string file ) : void
file string
리턴 void

프로퍼티 상세

script 공개적으로 프로퍼티

public Interaction,SunsetHigh script
리턴 Interaction