Exemplo n.º 1
0
        public long GetDefence()
        {
            var result = GetDefenceInternal();

            result  = Convert.ToInt64(result * EffectService.GetDefenceKoef());
            result += EffectService.GetDefenceBonus();
            return(result);
        }
Exemplo n.º 2
0
        public Task GetStatus()
        {
            StatusViewModel vm = new StatusViewModel();

            vm.bpm        = StreamingSetup.GetBPM();
            vm.IsAutoMode = EffectService.IsAutoModeRunning();

            return(Clients.All.SendAsync("Status", vm));
        }
Exemplo n.º 3
0
 public void Initialize()
 {
     LocationService   = new LocationService(LocationsInfo);
     ExperienceManager = new ExperienceManager(this);
     InventoryService  = new InventoryService(Inventory);
     CubeService       = new CubeService(this);
     SkillService      = new SkillService(this, Skills);
     EffectService     = new EffectService(this, Effects);
 }
Exemplo n.º 4
0
        public async Task Disconnect()
        {
            EffectService.CancelAllEffects();

            StreamingSetup.Disconnect();
            await Clients.All.SendAsync("effects", new EffectsVM());

            await Clients.All.SendAsync("StatusMsg", "DISCONNECTED...");

            GetStatus();
        }
Exemplo n.º 5
0
        public void SetUp()
        {
            var unitOfWorkFactory = Substitute.For <IUnitOfWorkFactory>();

            _unitOfWork = Substitute.For <IUnitOfWork>();
            unitOfWorkFactory.CreateUnitOfWork().Returns(_unitOfWork);
            _effectRepository = Substitute.For <IEffectRepository>();
            _unitOfWork.Effects.Returns(_effectRepository);
            _effectSubCategoryRepository = Substitute.For <IEffectSubCategoryRepository>();
            _unitOfWork.EffectSubCategories.Returns(_effectSubCategoryRepository);
            _effectTypeRepository = Substitute.For <IEffectTypeRepository>();
            _unitOfWork.EffectTypes.Returns(_effectTypeRepository);
            _authorizationUtil = Substitute.For <IAuthorizationUtil>();
            _effectService     = new EffectService(unitOfWorkFactory, _authorizationUtil);
        }
Exemplo n.º 6
0
        public async Task GetStatus()
        {
            var configs = await StreamingSetup.GetGroupConfigurationsAsync();

            StatusViewModel vm = new StatusViewModel();

            vm.bpm        = StreamingSetup.GetBPM();
            vm.IsAutoMode = EffectService.IsAutoModeRunning();
            vm.AutoModeHasRandomEffects = EffectService.AutoModeHasRandomEffects;
            vm.ShowDisconnect           = !(StreamingSetup.CurrentConnection?.HideDisconnect ?? false);
            vm.GroupNames   = configs.Select(x => x.Name).ToList();
            vm.CurrentGroup = StreamingSetup.CurrentConnection?.Name;

            await Clients.All.SendAsync("Status", vm);
        }
Exemplo n.º 7
0
        public void GetEffects(bool forAll)
        {
            if (StreamingSetup.Layers?.Count > 0)
            {
                var allEffects = EffectService.GetEffectViewModels();

                if (forAll)
                {
                    Clients.All.SendAsync("effects", allEffects);
                }
                else
                {
                    Clients.Caller.SendAsync("effects", allEffects);
                }
            }
        }
Exemplo n.º 8
0
        public Task GetEffects(bool forAll)
        {
            if (StreamingSetup.Layers?.Count > 0)
            {
                var allEffects = EffectService.GetEffectViewModels();

                if (forAll)
                {
                    return(Clients.All.SendAsync("effects", allEffects));
                }
                else
                {
                    return(Clients.Caller.SendAsync("effects", allEffects));
                }
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 9
0
        public Shaders()
        {
            Content.RootDirectory = "Content";

            // Komponenten erstellen
            camera       = CameraFactory.CreateCamera(this, CameraType.FreeLookCamera);
            shape        = new Shape(this);
            room         = new Shape(this);
            lightService = new LightService(this);
            crosshair    = new Crosshair(this)
            {
                Visible = false
            };
            effectService      = new EffectService();
            collisionDetection = new CollisionDetection(this);

            // Komponenten zur Engine hinzufügen
            Components.Add(new CameraHandler(this)
            {
                Camera = camera
            });
            Components.Add(camera);
            Components.Add(lightService);
            Components.Add(shape);
            Components.Add(room);
            Components.Add(crosshair);
            Components.Add(collisionDetection);

            // Services hinzufügen
            Services.AddService(typeof(ICameraService), camera);
            Services.AddService(typeof(ILightService), lightService);
            Services.AddService(typeof(IEffectService), effectService);

            // Grafik-Einstellungen
            graphics = new GraphicsDeviceManager(this);
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.PreferMultiSampling            = true;
            graphics.IsFullScreen              = true;
            graphics.PreferredBackBufferWidth  = 1366;
            graphics.PreferredBackBufferHeight = 768;

            IsFixedTimeStep = true;
        }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        MonsterHealthBar = GameObject.Find("MonsterStatus").GetComponentInChildren <SimpleHealthBar>();
        var gameState = GameObject.Find("GameState").GetComponent <GameState>();

        _player          = gameState.Player;
        _skillService    = _player.SkillService;
        _effectService   = _player.EffectService;
        _resourceManager = FindObjectOfType <ResourceManager>();
        _locationService = _player.LocationService;

        _canvasTransform = GameObject.Find("Canvas").transform;

        _defaultSkillCooldownBar = DefaultSkillSlot.GetComponentInChildren <SimpleHealthBar>();
        _activeSkillCooldownBars = ActiveSkillSlots.Select(s => s.GetComponentInChildren <SimpleHealthBar>()).ToArray();

        EventsSubscribe();

        _player.Respawn();
        _skillService.StartBattle();
        NewMonster();
    }
Exemplo n.º 11
0
 public void StartEffect(string typeName, string colorHex)
 {
     EffectService.StartEffect(typeName, colorHex);
 }
Exemplo n.º 12
0
 public void StartAutoMode()
 {
     EffectService.StartAutoMode();
     GetStatus();
 }
Exemplo n.º 13
0
 public void Beat(double intensity)
 {
     EffectService.Beat(intensity);
 }
Exemplo n.º 14
0
 public void Beat([FromBody] double intensity)
 {
     EffectService.Beat(intensity);
 }
Exemplo n.º 15
0
 public void OnDeathActivate(object obj, EventArgs e)
 {
     EffectService.RemoveAll();
 }
Exemplo n.º 16
0
 public void StartGroupEffect(string typeName, string colorHex, string groupName, string iteratorMode, string secondaryIteratorMode)
 {
     EffectService.StartEffect(typeName, colorHex, groupName, Enum.Parse <IteratorEffectMode>(iteratorMode), Enum.Parse <IteratorEffectMode>(secondaryIteratorMode));
 }
Exemplo n.º 17
0
 public void StartRandom()
 {
     EffectService.StartRandomEffect();
 }
Exemplo n.º 18
0
 public Task StopEffects()
 {
     EffectService.StopAutoMode();
     EffectService.StopEffects();
     return(GetStatus());
 }
Exemplo n.º 19
0
 public async Task Touch(double x, double y)
 {
     EffectService.StartRandomTouchEffect(x, y);
 }
Exemplo n.º 20
0
 static EffectTreeViewModel()
 {
     EffectService = new EffectService();
 }