Class BattleBackup
It is used in case of losing a round, to maintain the state of the player's equipment before the changes made during the preparation of the last round.
Namespace: AutoBattleFramework.BattleBehaviour.Backup
Assembly: cs.temp.dll.dll
Syntax
public class BattleBackup : MonoBehaviour
Fields
LastStageBackup
Backup of the last stage. Usually the first Preparation State in a stage.
Declaration
public BackupState LastStageBackup
Field Value
Type | Description |
---|---|
BackupState |
LastStateBackup
Backup of the last stage. Usually a Preparation State backup.
Declaration
public BackupState LastStateBackup
Field Value
Type | Description |
---|---|
BackupState |
Properties
Instance
Singleton of the Battle backup.
Declaration
public static BattleBackup Instance { get; }
Property Value
Type | Description |
---|---|
BattleBackup |
Methods
ApplyBackup(BackupState, BattleState, Transform, Int32)
Apply the Backup of the current BattleState.
Declaration
protected bool ApplyBackup(BackupState backup, BattleState state, Transform shopBackupTransform, int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
BackupState | backup | Backup data. |
BattleState | state | Current BattleState. |
Transform | shopBackupTransform | |
Int32 | PlayerIndex | Index of the player. Default 0. |
Returns
Type | Description |
---|---|
Boolean |
ApplyLastStageBackup(BattleState, Int32)
Apply the Stage backup. Deletes all player characters and objects, and resets those in the stage backup.
Declaration
public bool ApplyLastStageBackup(BattleState state, int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
BattleState | state | Current BattleState |
Int32 | PlayerIndex | Index of the player. Default 0. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the backup has been applied successfully. |
ApplyLastStateBackup(BattleState, Int32)
Apply the State backup. Deletes all player characters and objects, and resets those in the state backup.
Declaration
public bool ApplyLastStateBackup(BattleState state, int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
BattleState | state | Current BattleState |
Int32 | PlayerIndex | Index of the player. Default 0. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the backup has been applied successfully. |
BackupLastStage(BattleState, List<GameCharacter>, Bench[])
This copy is considered to be the first state of a phase, so it is advisable to call it only during the first state.
Declaration
public void BackupLastStage(BattleState state, List<GameCharacter> PlayerTeam, params Bench[] Benches)
Parameters
Type | Name | Description |
---|---|---|
BattleState | state | Current BattleState. |
List<GameCharacter> | PlayerTeam | List of player characters on the battlefield. |
Bench[] | Benches | All benches for which you want to make a backup copy. This can include character and item banks. |
BackupLastState(BattleState, List<GameCharacter>, Bench[])
Creates a backup copy of the GameActors in the current BattleState.
Declaration
public void BackupLastState(BattleState state, List<GameCharacter> PlayerTeam, params Bench[] Benches)
Parameters
Type | Name | Description |
---|---|---|
BattleState | state | Current BattleState. |
List<GameCharacter> | PlayerTeam | List of player characters on the battlefield. |
Bench[] | Benches | All benches for which you want to make a backup copy. This can include character and item banks. |
BackupPlayerTeam(BackupState, BattleState, List<GameCharacter>, Transform, Bench[])
Backup copy of the status of characters and characters. Can be used to return to the previous state of a round, before making changes.
Declaration
protected void BackupPlayerTeam(BackupState backup, BattleState state, List<GameCharacter> PlayerTeam, Transform shopBackupTransform, params Bench[] Benches)
Parameters
Type | Name | Description |
---|---|---|
BackupState | backup | Backup data. |
BattleState | state | Current BattleState |
List<GameCharacter> | PlayerTeam | List of player characters on the battlefield. |
Transform | shopBackupTransform | |
Bench[] | Benches | All benches for which you want to make a backup copy. This can include character and item banks. |
RemoveBackup(BackupState)
Remove a backup state. Destroys all GameActors that has been backed up.
Declaration
protected void RemoveBackup(BackupState backup)
Parameters
Type | Name | Description |
---|---|---|
BackupState | backup |
RemoveLastStageBackup()
Remove the Last Stage Backup.
Declaration
public void RemoveLastStageBackup()