Class IBattleMovement
Determine how the characters move and choose the target.
Namespace: AutoBattleFramework.Movement
Assembly: cs.temp.dll.dll
Syntax
public abstract class IBattleMovement
Constructors
IBattleMovement()
Declaration
public IBattleMovement()
Methods
CharacterMovement(GameCharacter)
Main method of movement. It is responsible for setting a target and moving the character.
Declaration
public virtual void CharacterMovement(GameCharacter ai)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | ai |
Dead(GameCharacter)
Set the caracter state as Dead
Declaration
public void Dead(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character |
FindNearestEnemy(GameCharacter)
Given a character, search for the nearest enemy character.
Declaration
protected virtual GameCharacter FindNearestEnemy(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character looking for an enemy. |
Returns
Type | Description |
---|---|
GameCharacter | Nearest enemy character from the given character. |
MoveTo(GameCharacter, GridCell, Boolean)
Determines the next position to which the character will move.
Declaration
protected virtual void MoveTo(GameCharacter character, GridCell cell, bool forceToCenter = false)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character to be moved. |
GridCell | cell | Final destination to which you want to move the character. |
Boolean | forceToCenter | Move the character to the center of the cell. Used when the final destination has been reached and proceeds to attack. |
NoTarget(GameCharacter)
Set the character state as NoTarget
Declaration
public void NoTarget(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character without target. |
ResolveTie(GameCharacter)
This method is invoked to solve the problem of two characters arriving at the same square. The second one that has arrived moves to the nearest unoccupied square.
Declaration
public virtual void ResolveTie(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Second character that has arrived in the cell. |
SetTargetAndMove(GameCharacter, GameCharacter)
Set the enemy target, the target cell to move and start the movement to that cell.
Declaration
protected virtual GridCell SetTargetAndMove(GameCharacter character, GameCharacter enemy)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character to set target. |
GameCharacter | enemy | Enemy character that os the current target. |
Returns
Type | Description |
---|---|
GridCell | Target cell where the character will move. |