Ejemplo n.º 1
0
        private ITeleportStrategy CreateTeleportStrategy(IRequest request, TeleportDescription description)
        {
            switch (description.descriptionType)
            {
            case TeleportDescriptionType.WithinZone:
            {
                var t = _teleportStrategyFactories.TeleportWithinZoneFactory();
                t.TargetPosition = description.GetRandomTargetPosition();
                return(t);
            }

            case TeleportDescriptionType.AnotherZone:
            {
                var toAnotherZone = _teleportStrategyFactories.TeleportToAnotherZoneFactory(description.TargetZone);
                toAnotherZone.TargetPosition = description.GetRandomTargetPosition();
                return(toAnotherZone);
            }

            case TeleportDescriptionType.TrainingExit:
            {
                var exitStrategy = _teleportStrategyFactories.TrainingExitStrategyFactory(description);
                exitStrategy.TrainingRewardLevel = request.Data.GetOrDefault <int>(k.rewardLevel);
                return(exitStrategy);
            }
            }

            return(null);
        }
Ejemplo n.º 2
0
 public TrainingExitStrategy(TeleportDescription description, ITrainingRewardRepository trainingRewardRepository, IChannelManager channelManager, CharacterCleaner characterCleaner, SparkHelper sparkHelper)
 {
     _description = description;
     _trainingRewardRepository = trainingRewardRepository;
     _channelManager           = channelManager;
     _characterCleaner         = characterCleaner;
     _sparkHelper = sparkHelper;
 }