default implementation for IAttackManager
attacker targets are chosen purely on distance
https://citybuilder.softleitner.com/manual/attacks
◆ AddAttacker()
void CityBuilderCore.DefaultAttackManager.AddAttacker |
( |
IAttacker | attacker | ) |
|
|
inline |
adds an attacker to the manager that can now be found by defenders
typically called by the attacker in Start
- Parameters
-
attacker | the attacker to add |
Implements CityBuilderCore.IAttackManager.
◆ GetAttacker()
IAttacker CityBuilderCore.DefaultAttackManager.GetAttacker |
( |
Vector3 | position, |
|
|
float | maxDistance ) |
|
inline |
retrieves the closest attacker to a given position
- Parameters
-
position | position of the defender that is looking for attackers |
maxDistance | maximum distance to look for |
- Returns
- the attacker if one was found inside the distance
Implements CityBuilderCore.IAttackManager.
◆ GetAttackerPath()
attempts to find a path to an IAttackable
- Parameters
-
point | current point to start from |
pathType | preferred path type |
tag | additional pathing option |
- Returns
- the attackable and a path to it if on was found
Implements CityBuilderCore.IAttackManager.
◆ GetAttackers()
IEnumerable< IAttacker > CityBuilderCore.DefaultAttackManager.GetAttackers |
( |
Vector3 | position, |
|
|
float | radius ) |
|
inline |
retrieves the all attackers within a radius
- Parameters
-
position | position of the defender that is looking for attackers |
radius | maximum distance to look for |
- Returns
- all attackers found inside the radius
Implements CityBuilderCore.IAttackManager.
◆ RemoveAttacker()
void CityBuilderCore.DefaultAttackManager.RemoveAttacker |
( |
IAttacker | attacker | ) |
|
|
inline |
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
-
Implements CityBuilderCore.IAttackManager.