setPlayer method

void setPlayer(
  1. int entity,
  2. String player
)

Make entity belong to player.

Implementation

void setPlayer(int entity, String player) {
  _playerByEntity[entity] = player;
  _entitiesByPlayer.putIfAbsent(player, Bag<int>.new).add(entity);
}