Menu

## Character
in package
implements CharacterInterface, CreateableInterface, GameAwareInterface, ExtendableModelInterface Uses Creator, SoftDeletable, PropertyManager, GameAware, ExtendableModel

Character.php : 36

Model for a character.

##### Tags

Entity

  (repositoryClass="LotGD\Core\Models\Repositories\CharacterRepository")

Table

  (name="characters")

### Interfaces, Classes and Traits

CharacterInterface
  Interface for the character model and all objects that mimick such a model.
CreateableInterface
  Interface for createable models.
GameAwareInterface
  Interface for classes that are aware of the game.
ExtendableModelInterface

### Table of Contents

$buffList : BuffList|null
$buffs : Collection|null
$deletedAt : mixed
$displayName : string
$fillable : array<string|int, mixed>
$game : Game
$health : int
$id : UuidInterface
$level : int
$maxHealth : int
$messageThreads : Collection|null
$name : string
$properties : Collection|null
$propertyClass : string
$propertyStorage : mixed
$viewpoint : Viewpoint|null
__call() : mixed
__construct() : mixed
  Construct an empty character.
__toString() : string
addBuff() : mixed
  Adds a buff to the buffList.
create() : CreateableInterface
  Creates and returns an entity instance and fills values.
createAtFullHealth() : self
  Creates a character at full health.
damage() : mixed
  Does damage to the entity.
delete() : mixed
  Deletes the entity.
getAttack() : int
  Returns the character's virtual attribute "attack".
getBuffs() : BuffList
  Returns a list of buffs.
getDefense() : int
  Returns the character's virtual attribute "defense".
getDeletedAt() : DateTime
  Returns when the entry got deleted.
getDisplayName() : string
  Returns displayName, a combination of title, name and suffix, mixed with colour codes.
getGame() : Game
getHealth() : int
  Returns current health.
getId() : int
  Returns the entity's id.
getLevel() : int
  Returns the character's level.
getMaxHealth() : int
  Returns the maximum health.
getMessageThreads() : Collection
  Returns a list of message threads this user has created.
getName() : string
  Returns the character's name.
getProperty() : mixed
  Returns a property with its stored type.
getViewpoint() : Viewpoint|null
  Returns the current character viewpoint or null if one is not set.
heal() : mixed
  Heals the enemy.
isAlive() : bool
  Returns true if the character is alive.
isDeleted() : bool
  Returns true if this entity is soft deleted.
loadProperties() : void
  Loads properties.
restore() : mixed
  Restores an entity back.
setDeletedAt() : mixed
  Sets deletedAt to a specific date.
setGame() : mixed
setHealth() : mixed
  Sets current health.
setLevel() : mixed
  Sets the character's level.
setMaxHealth() : mixed
  Sets the maximum health of a character to a given value. It also sets the health if none has been set yet.
setName() : mixed
  Sets the character's name and generates the display name.
setProperty() : void
  Sets a property to a given value.
setViewpoint() : mixed
  Sets the current character viewpoint.
unsetProperty() : void
  Deletes a property.
generateDisplayName() : mixed
  Generates the display name which is a composition of title and name.

### Properties

#### $buffList

Character.php : 85
`private BuffList|null $buffList`

#### $buffs

Character.php : 83
`private Collection|null $buffs`

##### Tags

OneToMany

  (targetEntity="Buff", mappedBy="character", cascade={"persist"})

#### $deletedAt

SoftDeletable.php : 15
`private mixed $deletedAt`

##### Tags

Column

  (type="datetime", nullable=true)

#### $displayName

Character.php : 51
`private string $displayName = ""`

##### Tags

Column

  (type="text");

#### $fillable

Character.php : 87
`private static array<string|int, mixed> $fillable = ["name", "maxHealth", "level"]`

#### $game

GameAware.php : 13
`private Game $game`

#### $health

Character.php : 57
`private int $health = 10`

##### Tags

Column

  (type="integer", options={"default"=10})

#### $id

Character.php : 45
`private UuidInterface $id`

##### Tags

Id

  @Column(type="uuid", unique=True)

#### $level

Character.php : 60
`private int $level = 1`

##### Tags

Column

  (type="integer", options={"default"=1})/

#### $maxHealth

Character.php : 54
`private int $maxHealth = 10`

##### Tags

Column

  (type="integer", options={"default"=10})

#### $messageThreads

Character.php : 80
`private Collection|null $messageThreads`

##### Tags

ManyToMany

  (targetEntity="MessageThread", inversedBy="participants", cascade={"persist"})

JoinTable

  ( name="message_threads_x_characters", joinColumns={ @JoinColumn(name="character_id", referencedColumnName="id") }, inverseJoinColumns={ @JoinColumn(name="messagethread_id", referencedColumnName="id") } )

#### $name

Character.php : 48
`private string $name = ""`

##### Tags

Column

  (type="string", length=50);

#### $properties

Character.php : 63
`private Collection|null $properties`

##### Tags

OneToMany

  (targetEntity="CharacterProperty", mappedBy="owner", cascade={"persist", "remove"})

#### $propertyClass

Character.php : 93
`private string $propertyClass = LotGDCoreModelsCharacterProperty::class`

#### $propertyStorage

PropertyManager.php : 11
`private mixed $propertyStorage = null`

#### $viewpoint

Character.php : 66
`private Viewpoint|null $viewpoint = null`

##### Tags

OneToOne

  (targetEntity="Viewpoint", mappedBy="owner", cascade={"persist", "remove"})

### Methods

#### __call()

ExtendableModel.php : 18
`public __call(mixed $method, mixed $arguments) : mixed`

##### Parameters

$method : mixed
$arguments : mixed

##### Return values

mixed —

#### __construct()

Character.php : 109

Construct an empty character.

`public __construct() : mixed`

##### Return values

mixed —

#### __toString()

Character.php : 121
`public __toString() : string`

##### Return values

string —

#### addBuff()

Character.php : 338

Adds a buff to the buffList.

`public addBuff(Buff $buff[, bool $override = false ]) : mixed`

##### Parameters

$buff : Buff
$override : bool = false

##### Return values

mixed —

#### create()

Creator.php : 25

Creates and returns an entity instance and fills values.

`public static create(array<string|int, mixed> $arguments) : CreateableInterface`

##### Parameters

$arguments : array<string|int, mixed>

  The values the instance should get

##### Tags

throws
  WrongTypeException|UnexpectedArrayKeyException
throws
  AttributeMissingException

##### Return values

CreateableInterface —

The created Entity

#### createAtFullHealth()

Character.php : 98

Creates a character at full health.

`public static createAtFullHealth(array<string|int, mixed> $arguments) : self`

##### Parameters

$arguments : array<string|int, mixed>

##### Return values

self —

#### damage()

Character.php : 212

Does damage to the entity.

`public damage(int $damage) : mixed`

##### Parameters

$damage : int

##### Return values

mixed —

#### delete()

SoftDeletable.php : 21

Deletes the entity.

`public delete(EntityManagerInterface $em) : mixed`

##### Parameters

$em : EntityManagerInterface

##### Return values

mixed —

#### getAttack()

Character.php : 258

Returns the character's virtual attribute "attack".

`public getAttack([bool $ignoreBuffs = false ]) : int`

##### Parameters

$ignoreBuffs : bool = false

##### Return values

int —

#### getBuffs()

Character.php : 327

Returns a list of buffs.

`public getBuffs() : BuffList`

##### Return values

BuffList —

#### getDefense()

Character.php : 280

Returns the character's virtual attribute "defense".

`public getDefense([bool $ignoreBuffs = false ]) : int`

##### Parameters

$ignoreBuffs : bool = false

##### Return values

int —

#### getDeletedAt()

SoftDeletable.php : 50

Returns when the entry got deleted.

`public getDeletedAt() : DateTime`

##### Return values

DateTime —

#### getDisplayName()

Character.php : 166

Returns displayName, a combination of title, name and suffix, mixed with colour codes.

`public getDisplayName() : string`

##### Return values

string —

The displayName

#### getGame()

GameAware.php : 26
`public getGame() : Game`

##### Return values

Game —

#### getHealth()

Character.php : 203

Returns current health.

`public getHealth() : int`

##### Return values

int —

#### getId()

Character.php : 130

Returns the entity's id.

`public getId() : int`

##### Return values

int —

The id

#### getLevel()

Character.php : 248

Returns the character's level.

`public getLevel() : int`

##### Return values

int —

#### getMaxHealth()

Character.php : 185

Returns the maximum health.

`public getMaxHealth() : int`

##### Return values

int —

#### getMessageThreads()

Character.php : 351

Returns a list of message threads this user has created.

`public getMessageThreads() : Collection`

##### Return values

Collection —

#### getName()

Character.php : 149

Returns the character's name.

`public getName() : string`

##### Return values

string —

The name

#### getProperty()

PropertyManager.php : 33

Returns a property with its stored type.

`public getProperty(string $name[, mixed $default = null ]) : mixed`

##### Parameters

$name : string
$default : mixed = null

##### Return values

mixed —

#### getViewpoint()

Character.php : 310

Returns the current character viewpoint or null if one is not set.

`public getViewpoint() : Viewpoint|null`

##### Return values

Viewpoint|null —

#### heal()

Character.php : 226

Heals the enemy.

`public heal(int $heal[, bool $overheal = false ]) : mixed`

##### Parameters

$heal : int
$overheal : bool = false

  True if healing bigger than maxHealth is desired.

##### Return values

mixed —

#### isAlive()

Character.php : 239

Returns true if the character is alive.

`public isAlive() : bool`

##### Return values

bool —

#### isDeleted()

SoftDeletable.php : 59

Returns true if this entity is soft deleted.

`public isDeleted() : bool`

##### Return values

bool —

#### loadProperties()

PropertyManager.php : 16

Loads properties.

`public loadProperties() : void`

##### Return values

void —

#### restore()

SoftDeletable.php : 31

Restores an entity back.

`public restore(EntityManagerInterface $em) : mixed`

##### Parameters

$em : EntityManagerInterface

##### Return values

mixed —

#### setDeletedAt()

SoftDeletable.php : 41

Sets deletedAt to a specific date.

`public setDeletedAt([DateTime|null $deletedAt = null ]) : mixed`

##### Parameters

$deletedAt : DateTime|null = null

##### Return values

mixed —

#### setGame()

GameAware.php : 18
`public setGame(Game $game) : mixed`

##### Parameters

$game : Game

##### Return values

mixed —

#### setHealth()

Character.php : 194

Sets current health.

`public setHealth(int $health) : mixed`

##### Parameters

$health : int

##### Return values

mixed —

#### setLevel()

Character.php : 301

Sets the character's level.

`public setLevel(int $level) : mixed`

##### Parameters

$level : int

##### Return values

mixed —

#### setMaxHealth()

Character.php : 176

Sets the maximum health of a character to a given value. It also sets the health if none has been set yet.

`public setMaxHealth(int $maxHealth) : mixed`

##### Parameters

$maxHealth : int

##### Return values

mixed —

#### setName()

Character.php : 139

Sets the character's name and generates the display name.

`public setName(string $name) : mixed`

##### Parameters

$name : string

  The name to set

##### Return values

mixed —

#### setProperty()

PropertyManager.php : 63

Sets a property to a given value.

`public setProperty(string $name, mixed $value) : void`

##### Parameters

$name : string
$value : mixed

##### Return values

void —

#### setViewpoint()

Character.php : 319

Sets the current character viewpoint.

`public setViewpoint(Viewpoint|null $v) : mixed`

##### Parameters

$v : Viewpoint|null

##### Return values

mixed —

#### unsetProperty()

PropertyManager.php : 47

Deletes a property.

`public unsetProperty(string $name) : void`

##### Parameters

$name : string

##### Return values

void —

#### generateDisplayName()

Character.php : 157

Generates the display name which is a composition of title and name.

`protected generateDisplayName() : mixed`

##### Return values

mixed —

## Search results