Example #1
0
        public void Add(TSource source, TDestination destination)
        {
            if (forward.ContainsKey(source))
            {
                throw new ArgumentException("The parameter 'source' is already mapped to some destination.");
            }
            if (reverse.ContainsKey(destination))
            {
                throw new ArgumentException("The parameter 'destination' is already mapped to some source.");
            }

            forward.Add(source, destination);
            reverse.Add(destination, source);
        }
    public void RegisterPlayer(InputDataHolder playerInfo)
    {
        Guid    playerGuid = (Guid)playerInfo.data;
        IPlayer player     = InstantiatePlayer(false);

        playerToGuid.Add(playerGuid, player);

        StartCoroutine(SendPlayerColor((Player)player));

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