Exemplo n.º 1
0
        public void RemovePlayerEntity(PlayerEntity playerEntity)
        {
            var coincidence = PlayerEntities.FirstOrDefault(x => x == playerEntity);

            // Он был зарегестрирован.
            if (coincidence != null)
            {
                PlayerEntities.Remove(playerEntity);
                OnPlayerEntityRemove(playerEntity);
            }
        }
Exemplo n.º 2
0
        // Эти методы не особо нужны. Они создавались только для поддержки серверной сущности.

        public void AddPlayerEntity(PlayerEntity playerEntity)
        {
            var coincidence = PlayerEntities.FirstOrDefault(x => x == playerEntity);

            // Он не был зарегестрирован.
            if (coincidence == null)
            {
                PlayerEntities.Add(playerEntity);
                OnPlayerEntityAdd(playerEntity);
            }
        }