Server Enemy Worker
The ServerEnemyWorker
is responsible for managing enemy entities within the game.
Properties
public static uint enemyCount
: Represents the total count of enemies.public Dictionary<uint, Element> enemies
: Represents a collection of enemies.
Constructors
public ServerEnemyWorker()
: Initializes a new instance of theServerEnemyWorker,
and sets up theenemies
dictionary for storing enemy data.
Methods
public void AddEnemy(Enemy enemy)
: Adds a new enemy to the game. It assigns a unique ID to the enemy based on the current value ofenemyCount
and incrementsenemyCount
after adding the enemy to ensure uniqueness for subsequent enemies.public void RemoveEnemy(uint id)
: Removes an enemy from the game using its unique ID. If the ID is found in theenemies
dictionary, the corresponding enemy is removed.
Last updated