Esempio n. 1
0
        public void Remove(TSource source, TDestination destination)
        {
            if (EqualityComparer <TDestination> .Default.Equals(forward[source], destination))
            {
                throw new ArgumentException("Source doesn't map to destination.");
            }
            if (EqualityComparer <TSource> .Default.Equals(reverse[destination], source))
            {
                throw new ArgumentException("Destination doesn't map to source.");
            }

            forward.Remove(source);
            reverse.Remove(destination);
        }
Esempio n. 2
0
 public void RemoveEntity(Entity entity)
 {
     if (entity.Scene != null && entity.Scene != scene)
     {
         RemoveEntity(entity);
         LogEvent.Engine.Warning("Entity was already registered in another scene.");
     }
     componentsByEntity.Remove(entity.Id);
     entities.Remove(entity.Id);
     OnEntityRemoved(new EntityEventArgs(entity));
 }
Esempio n. 3
0
    public void UnregisterPlayer(InputDataHolder playerInfo)
    {
        IPlayer           player      = playerToGuid.Forward[(Guid)playerInfo.identifier];
        PlayerConstraints constraints = playerConstraints[player];

        playerConstraints.Remove(player);
        playerToGuid.Remove((Guid)playerInfo.identifier);

        player.DestroyMe();
        Destroy(constraints.MenuPlayer.gameObject);

        if (GameManager.instance.GetActiveGameScene() == GameScene.Menu)
        {
            GameManager.instance.UpdatePlayerCount(playerToGuid.GetKeys().Count);
        }
        else if (GameManager.instance.GetActiveGameScene() == GameScene.Game)
        {
            CheckRemainingPlayers();
        }
    }