Class TEntity

Unit

Declaration

type TEntity = class(TObject)

Description

Class to represent living things on the map (entities).

Warning
This is an "abstract" class and shouldn't be used directly, but instead through one of its subclasses

Hierarchy

Overview

Methods

Public constructor Create(aname: string; ahealth, adamage: integer);
Public function attack(aenemy: TEntity): integer;

Properties

Public property health: integer read _health write _set_health;
Public property is_alive: boolean read _is_alive;
Public property max_health: integer read _max_health;
Public property Name: string read _name;
Public property damage: integer read _damage;

Description

Methods

Public constructor Create(aname: string; ahealth, adamage: integer);

Base constructor for new entities

Parameters
aname
The name of the entity.
ahealth
The initial and therefore maximum health of the entity.
adamage
The initial damage the entity should make.
Returns

A new instance of TEntity.

Public function attack(aenemy: TEntity): integer;

Procedure to attack other entities.

Parameters
aenemy
The entity to attack.

Properties

Public property health: integer read _health write _set_health;

Integer-Property representing the entities current health.

Public property is_alive: boolean read _is_alive;

Read-only Boolean-Property indicating if the entity is still alive.

Public property max_health: integer read _max_health;
 
Public property Name: string read _name;

Read-only String-Property containing the name of the entity.

Public property damage: integer read _damage;

Read-only Integer-property representing the damage the entity makes without weapons.


Generated by PasDoc 0.16.0.