Loading...
Searching...
No Matches
CityBuilderCore.IAttackManager Interface Reference

Detailed Description

manages attack system

attackers attack attackableComponents and get fended off by defenderComponents
all entities with health get healthbars

Inheritance diagram for CityBuilderCore.IAttackManager:
CityBuilderCore.DefaultAttackManager

Public Member Functions

void AddAttacker (IAttacker attacker)
 adds an attacker to the manager that can now be found by defenders
typically called by the attacker in Start
 
void RemoveAttacker (IAttacker attacker)
 removes a previously added attacker from the manager, it can no longer be found by defenders
typically called by the attacker in OnDestroy when it has been killed
 
IAttacker GetAttacker (Vector3 position, float maxDistance)
 retrieves the closest attacker to a given position
 
IEnumerable< IAttackerGetAttackers (Vector3 position, float radius)
 retrieves the all attackers within a radius
 
BuildingComponentPath< IAttackableGetAttackerPath (Vector2Int point, PathType pathType, object tag=null)
 attempts to find a path to an IAttackable
 

Member Function Documentation

◆ AddAttacker()

void CityBuilderCore.IAttackManager.AddAttacker ( IAttacker attacker)

adds an attacker to the manager that can now be found by defenders
typically called by the attacker in Start

Parameters
attackerthe attacker to add

Implemented in CityBuilderCore.DefaultAttackManager.

◆ GetAttacker()

IAttacker CityBuilderCore.IAttackManager.GetAttacker ( Vector3 position,
float maxDistance )

retrieves the closest attacker to a given position

Parameters
positionposition of the defender that is looking for attackers
maxDistancemaximum distance to look for
Returns
the attacker if one was found inside the distance

Implemented in CityBuilderCore.DefaultAttackManager.

◆ GetAttackerPath()

BuildingComponentPath< IAttackable > CityBuilderCore.IAttackManager.GetAttackerPath ( Vector2Int point,
PathType pathType,
object tag = null )

attempts to find a path to an IAttackable

Parameters
pointcurrent point to start from
pathTypepreferred path type
tagadditional pathing option
Returns
the attackable and a path to it if on was found

Implemented in CityBuilderCore.DefaultAttackManager.

◆ GetAttackers()

IEnumerable< IAttacker > CityBuilderCore.IAttackManager.GetAttackers ( Vector3 position,
float radius )

retrieves the all attackers within a radius

Parameters
positionposition of the defender that is looking for attackers
radiusmaximum distance to look for
Returns
all attackers found inside the radius

Implemented in CityBuilderCore.DefaultAttackManager.

◆ RemoveAttacker()

void CityBuilderCore.IAttackManager.RemoveAttacker ( IAttacker attacker)

removes a previously added attacker from the manager, it can no longer be found by defenders
typically called by the attacker in OnDestroy when it has been killed

Parameters
attacker

Implemented in CityBuilderCore.DefaultAttackManager.