C# 클래스 Gruppe22.Backend.Actor

A living entity (backend) for example the player
파일 보기 프로젝트 열기: propra13-orga/gruppe22 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
_quicklist List

보호된 프로퍼티들

프로퍼티 타입 설명
_GUID string
_abilities List
_abilityPoints int
_actorType ActorType
_aggro bool
_animationFile string
_armor int
_block int
_charmed int
_checkPointCoords Coords
_crazy bool
_damage int
_destroyArmor int
_destroyWeapon int
_direction Direction
_evade int
_exp int
_expNeeded int
_fireDamage int
_fireDefense int
_friendly bool
_gold int
_health int
_healthReg int
_iceDamage int
_iceDefense int
_id int
_inventory List
_lastCheckpoint int
_level int
_lives int
_locked bool
_mana int
_manaReg int
_maxMana int
_maxhealth int
_name string
_newItems int
_online bool
_penetrate int
_random System.Random
_ranged bool
_regCounter int
_resist int
_scared int
_skills int
_stealHealth int
_stealMana int
_stunned int
_tile ActorTile
_viewRange int

공개 메소드들

메소드 설명
Actor ( ActorType actorType, int health, int armor, int damage, int maxHealth = -1, string name = "", Random rnd = null, string animationFile = "", int level = -1 ) : System

The constructor used for actors. Sets default values for the most important properties.

AddHealth ( int amount ) : void

Method to let the player get some health back

AddItem ( Item item ) : void

Add new item to inventory

AddProtection ( int amount ) : void

Method to increase the amount of armor an actor has. Does not change anything if armor>amount

AddStrength ( int amount ) : void

Method to directly increase the damage an actor deals. Does nothing if damage>amount.

FromXML ( string input ) : Actor

Get character data from an XML-string

GenerateName ( string filename ) : string

Method to choose an random actor name from a file.

GenerateName ( ) : void

Method to generate a random actor name. Uses GenerateName() for files if a file exists. Otherwise chooses one of six random names.

HasKey ( int level ) : bool

Methode to determine if the player has the key to the next level.

Items ( int i ) : Item

Method to get the items an actor has.

LevelUp ( ) : void

Method called when the exp reach the needed exp. Lets the player level up. The actor gains abilitypoints, skills and his health is set to maxhealth. Also the needed exp increase for the next level.

Load ( XmlReader reader ) : void

Method to read actor properties from a XML-file.

Regen ( ) : void

Method to let the player regenerate mana and health.

Save ( XmlWriter writer ) : void

Method to save an actor in an XML-file. Just writes every property to the file.

ToString ( ) : string

Changed ToString Method for the actor's name.

ToXML ( ) : string

Write all data as an XML-string

copyFrom ( Actor a ) : void

Duplicates the properties of actor a to the current actor.

메소드 상세

Actor() 공개 메소드

The constructor used for actors. Sets default values for the most important properties.
public Actor ( ActorType actorType, int health, int armor, int damage, int maxHealth = -1, string name = "", Random rnd = null, string animationFile = "", int level = -1 ) : System
actorType ActorType Player, NPC oder Enemy
health int Standardwert 15+random(30) or 5+random(maxhealth-5) if maxhealth is passed
armor int default random(10)
damage int default 12+random(10)
maxHealth int default = health
name string uses GenerateName() by default
rnd System.Random a random used to generate the actors starting values
animationFile string the file used to display the actor
level int the default starting level is 1
리턴 System

AddHealth() 공개 메소드

Method to let the player get some health back
public AddHealth ( int amount ) : void
amount int The amount of healthpoints that should be added
리턴 void

AddItem() 공개 메소드

Add new item to inventory
public AddItem ( Item item ) : void
item Item The item to add to inventory
리턴 void

AddProtection() 공개 메소드

Method to increase the amount of armor an actor has. Does not change anything if armor>amount
public AddProtection ( int amount ) : void
amount int the new amount the armor the actor should have
리턴 void

AddStrength() 공개 메소드

Method to directly increase the damage an actor deals. Does nothing if damage>amount.
public AddStrength ( int amount ) : void
amount int The new amount of damage the actor should deal
리턴 void

FromXML() 공개 메소드

Get character data from an XML-string
public FromXML ( string input ) : Actor
input string
리턴 Actor

GenerateName() 공개 메소드

Method to choose an random actor name from a file.
public GenerateName ( string filename ) : string
filename string The file with one name per line
리턴 string

GenerateName() 공개 메소드

Method to generate a random actor name. Uses GenerateName() for files if a file exists. Otherwise chooses one of six random names.
public GenerateName ( ) : void
리턴 void

HasKey() 공개 메소드

Methode to determine if the player has the key to the next level.
public HasKey ( int level ) : bool
level int The level for which the key is checked.
리턴 bool

Items() 공개 메소드

Method to get the items an actor has.
public Items ( int i ) : Item
i int The id of the item
리턴 Item

LevelUp() 공개 메소드

Method called when the exp reach the needed exp. Lets the player level up. The actor gains abilitypoints, skills and his health is set to maxhealth. Also the needed exp increase for the next level.
public LevelUp ( ) : void
리턴 void

Load() 공개 메소드

Method to read actor properties from a XML-file.
public Load ( XmlReader reader ) : void
reader XmlReader The used XMLReader for reading the actor.
리턴 void

Regen() 공개 메소드

Method to let the player regenerate mana and health.
public Regen ( ) : void
리턴 void

Save() 공개 메소드

Method to save an actor in an XML-file. Just writes every property to the file.
public Save ( XmlWriter writer ) : void
writer System.Xml.XmlWriter The writer which should be used to save the data
리턴 void

ToString() 공개 메소드

Changed ToString Method for the actor's name.
public ToString ( ) : string
리턴 string

ToXML() 공개 메소드

Write all data as an XML-string
public ToXML ( ) : string
리턴 string

copyFrom() 공개 메소드

Duplicates the properties of actor a to the current actor.
public copyFrom ( Actor a ) : void
a Actor The actor from which the properties should be cloned
리턴 void

프로퍼티 상세

_GUID 보호되어 있는 프로퍼티

A unique identity used in online games
protected string _GUID
리턴 string

_abilities 보호되어 있는 프로퍼티

protected List _abilities
리턴 List

_abilityPoints 보호되어 있는 프로퍼티

protected int _abilityPoints
리턴 int

_actorType 보호되어 있는 프로퍼티

protected ActorType _actorType
리턴 ActorType

_aggro 보호되어 있는 프로퍼티

protected bool _aggro
리턴 bool

_animationFile 보호되어 있는 프로퍼티

protected string _animationFile
리턴 string

_armor 보호되어 있는 프로퍼티

protected int _armor
리턴 int

_block 보호되어 있는 프로퍼티

protected int _block
리턴 int

_charmed 보호되어 있는 프로퍼티

protected int _charmed
리턴 int

_checkPointCoords 보호되어 있는 프로퍼티

Coordinates of last checkpoint
protected Coords _checkPointCoords
리턴 Coords

_crazy 보호되어 있는 프로퍼티

protected bool _crazy
리턴 bool

_damage 보호되어 있는 프로퍼티

protected int _damage
리턴 int

_destroyArmor 보호되어 있는 프로퍼티

protected int _destroyArmor
리턴 int

_destroyWeapon 보호되어 있는 프로퍼티

protected int _destroyWeapon
리턴 int

_direction 보호되어 있는 프로퍼티

protected Direction _direction
리턴 Direction

_evade 보호되어 있는 프로퍼티

protected int _evade
리턴 int

_exp 보호되어 있는 프로퍼티

protected int _exp
리턴 int

_expNeeded 보호되어 있는 프로퍼티

protected int _expNeeded
리턴 int

_fireDamage 보호되어 있는 프로퍼티

protected int _fireDamage
리턴 int

_fireDefense 보호되어 있는 프로퍼티

protected int _fireDefense
리턴 int

_friendly 보호되어 있는 프로퍼티

protected bool _friendly
리턴 bool

_gold 보호되어 있는 프로퍼티

protected int _gold
리턴 int

_health 보호되어 있는 프로퍼티

protected int _health
리턴 int

_healthReg 보호되어 있는 프로퍼티

protected int _healthReg
리턴 int

_iceDamage 보호되어 있는 프로퍼티

protected int _iceDamage
리턴 int

_iceDefense 보호되어 있는 프로퍼티

protected int _iceDefense
리턴 int

_id 보호되어 있는 프로퍼티

protected int _id
리턴 int

_inventory 보호되어 있는 프로퍼티

protected List _inventory
리턴 List

_lastCheckpoint 보호되어 있는 프로퍼티

protected int _lastCheckpoint
리턴 int

_level 보호되어 있는 프로퍼티

protected int _level
리턴 int

_lives 보호되어 있는 프로퍼티

Number of lives (ressurection)
protected int _lives
리턴 int

_locked 보호되어 있는 프로퍼티

protected bool _locked
리턴 bool

_mana 보호되어 있는 프로퍼티

protected int _mana
리턴 int

_manaReg 보호되어 있는 프로퍼티

protected int _manaReg
리턴 int

_maxMana 보호되어 있는 프로퍼티

protected int _maxMana
리턴 int

_maxhealth 보호되어 있는 프로퍼티

protected int _maxhealth
리턴 int

_name 보호되어 있는 프로퍼티

protected string _name
리턴 string

_newItems 보호되어 있는 프로퍼티

protected int _newItems
리턴 int

_online 보호되어 있는 프로퍼티

Determines whether player is available
protected bool _online
리턴 bool

_penetrate 보호되어 있는 프로퍼티

protected int _penetrate
리턴 int

_quicklist 공개적으로 프로퍼티

public List _quicklist
리턴 List

_random 보호되어 있는 프로퍼티

A random number generator
protected Random,System _random
리턴 System.Random

_ranged 보호되어 있는 프로퍼티

protected bool _ranged
리턴 bool

_regCounter 보호되어 있는 프로퍼티

Internal counter for regeneration of health or mana
protected int _regCounter
리턴 int

_resist 보호되어 있는 프로퍼티

protected int _resist
리턴 int

_scared 보호되어 있는 프로퍼티

protected int _scared
리턴 int

_skills 보호되어 있는 프로퍼티

protected int _skills
리턴 int

_stealHealth 보호되어 있는 프로퍼티

protected int _stealHealth
리턴 int

_stealMana 보호되어 있는 프로퍼티

protected int _stealMana
리턴 int

_stunned 보호되어 있는 프로퍼티

protected int _stunned
리턴 int

_tile 보호되어 있는 프로퍼티

protected ActorTile _tile
리턴 ActorTile

_viewRange 보호되어 있는 프로퍼티

protected int _viewRange
리턴 int