Ejemplo n.º 1
0
 public void OnPowerUpRemoved(object source, GameplayPowerUpEventArgs args)
 {
     if (Pjs.TryGetValue(args.PlayerId, out Pj pj))
     {
         pj.PowerUp = null;
     }
     else
     {
         throw new System.ComponentModel.InvalidEnumArgumentException();
     }
 }
Ejemplo n.º 2
0
        public void OnPowerUpAdded(object source, GameplayPowerUpEventArgs args)
        {
            if (Pjs.TryGetValue(args.PlayerId, out Pj pj))
            {
                switch (args.Type)
                {
                case (int)PowerUpTypes.SprintPowerUp:
                    pj.PowerUp = new SprintPowerUp();
                    break;

                case (int)PowerUpTypes.TraverseWallsPowerUp:
                    pj.PowerUp = new TraverseWallsPowerUp();
                    break;

                case (int)PowerUpTypes.BananaPowerUp:
                    pj.PowerUp = new BananaPowerUp();
                    break;

                case (int)PowerUpTypes.InvisiblePowerUp:
                    pj.PowerUp = new InvisiblePowerUp();
                    break;

                case (int)PowerUpTypes.TintaPowerUp:
                    pj.PowerUp = new TintaPowerUp();
                    break;

                case (int)PowerUpTypes.ImmunePowerUp:
                    pj.PowerUp = new ImmunePowerUp();
                    break;

                case (int)PowerUpTypes.RandomTeleportPowerUp:
                    pj.PowerUp = new RandomTeleportPowerUp();
                    break;

                case (int)PowerUpTypes.RelojPowerUp:
                    pj.PowerUp = new RelojPowerUp();
                    break;

                default:
                    throw new System.ComponentModel.InvalidEnumArgumentException();
                }
            }
        }