public BuffAbility2(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice, CommandProcessor command,
                            IFactory <IBuff, BuffData, BuffTargetCommand> buffFactory,
                            IFactory <CCData, RootCommand> cCFactory,
                            IFactory <CCData, SilenceCommand> silenceFactory,
                            IFactory <CCData, FreezeCommand> freezeFactory,
                            IFactory <CCData, KnockUpCommand> knockUpFactory,
                            IFactory <CCData, LaunchCommand> launchFactory,
                            IFactory <CCData, HookCommand> hookFactory,
                            IFactory <CCData, PetrifyCommand> petrifyFactory,
                            IFactory <IStatChange, StatChangeData, StatChangeCommand> statChangeFactory,
                            IFactory <StatChangeData, HPChangeCommand> hPChangeFactory,
                            IFactory <StatChangeData, ResurrectCommand> resurrectFactory)

        {
            _unit              = unit;
            _world             = world;
            _command           = command;
            _data              = new BuffAbilityParams(data);
            _tickService       = tickservice;
            _buffFactory       = buffFactory;
            _rootFactory       = cCFactory;
            _silenceFactory    = silenceFactory;
            _freezeFactory     = freezeFactory;
            _knockUpFactory    = knockUpFactory;
            _launchFactory     = launchFactory;
            _hookFactory       = hookFactory;
            _petrifyFactory    = petrifyFactory;
            _statChangeFactory = statChangeFactory;
            _hPChangeFactory   = hPChangeFactory;
            _resurrectFactory  = resurrectFactory;
        }
 public BuffTargetCommand(IBuff iBuff, BuffData buffData, TickService tick)
 {                      //takes in this unit
     _buffData = buffData;
     _iBuff    = iBuff; //this is actually bringing in the instance of the wrapper buff, not the "class" iBuff.
     //you can call it IBuff because it extends it, and use the IBuff method because it extends it.
     _tick = tick;
 }
Exemple #3
0
        private void GlassesEditor_FormClosing(object sender, FormClosingEventArgs e)
        {
            SaveService saveService = (SaveService)ToolFramework.Instance.ServiceManagerInstance.GetService(typeof(SaveService));

            if (saveService != null && !saveService.Stop())
            {
                e.Cancel = true;
            }
            else if (!this.allowShutdown)
            {
                if (ToolFramework.Instance.Game != null)
                {
                    ToolFramework.Instance.Game.Exit();
                }
                e.Cancel     = true;
                this.closing = true;
            }
            else
            {
                TickService tickService = (TickService)ToolFramework.Instance.ServiceManagerInstance.GetService(typeof(TickService));
                if (tickService != null)
                {
                    tickService.Stop();
                }
            }
        }
Exemple #4
0
        private async Task <ServiceProvider> ConfigureServicesAsync(Database database)
        {
            DiscordSocketClient client = new DiscordSocketClient();

            Container playersRepositoryContainer = await PlayersRepository.CreateContainer(database);

            PlayersRepository playersRepository = new PlayersRepository(playersRepositoryContainer);

            Container adventuresRepositoryContainer = await AdventuresRepository.CreateContainer(database);

            AdventuresRepository adventuresRepository = new AdventuresRepository(adventuresRepositoryContainer);

            TickService tickService = new TickService(playersRepository, adventuresRepository);
            UIService   uiService   = new UIService(client, playersRepository, adventuresRepository);

            return(new ServiceCollection()
                   .AddSingleton(client)
                   .AddSingleton <CommandService>()
                   .AddSingleton <CommandHandlingService>()
                   .AddSingleton <HttpClient>()
                   .AddSingleton(tickService)
                   .AddSingleton(uiService)
                   .AddSingleton(playersRepository)
                   .AddSingleton(adventuresRepository)
                   .BuildServiceProvider());
        }
 public UnitUpdateAbility(UnitModel unit, AbilityData data, CommandProcessor command, TickService tick,
                          IFactory <IStatChange, StatChangeData, StatChangeCommand> statChangeFactory)
 {
     _unit              = unit;
     _tick              = tick;
     _command           = command;
     _statChangeFactory = statChangeFactory;
 }
 public Ability3(UnitModel unit, WorldModel world, TickService tickService,
                 CommandProcessor commandProcessor, AbilityVariablesRegistry abilityVariablesRegistry)
 {
     _unit                     = unit;
     _world                    = world;
     _tickService              = tickService;
     _commandProcessor         = commandProcessor;
     _abilityVariablesRegistry = abilityVariablesRegistry;
     _abilityData              = _abilityVariablesRegistry [3];  //this is fine here but could be set in the unit as well
 }
 public Ability4(UnitModel unit, WorldModel world, TickService tickService,
                 CommandProcessor commandProcessor, AbilityVariablesRegistry abilityVariablesRegistry)
 {
     _unit                     = unit;
     _world                    = world;
     _tickService              = tickService;
     _commandProcessor         = commandProcessor;
     _abilityVariablesRegistry = abilityVariablesRegistry;
     _abilityData              = _abilityVariablesRegistry [2];
 }
Exemple #8
0
        public override void OnInit()
        {
            base.OnInit();
            if (m_TickOrder == null)
            {
                m_TickOrder = 0;
            }

            TickService.AddUpdateCallback(OnUpdate, TickOrder);
        }
 public AbilityMakerAbility(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice,
                            CommandProcessor command, UnitRegistry unitRegistry, AbilityRepository abilityRepository)
 {
     _unit              = unit;
     _world             = world;
     _command           = command;
     _data              = new BuffAbilityParams(data);
     _tickService       = tickservice;
     _unitRegistry      = unitRegistry;
     _abilityRepository = abilityRepository;
 }
Exemple #10
0
 public ShieldSplashAbility(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice, CommandProcessor command,
                            IFactory <IStatChange, StatChangeData, StatChangeCommand> statChangeFactory
                            )
 {
     _unit              = unit;
     _world             = world;
     _command           = command;
     _data              = new BuffAbilityParams(data);
     _tickService       = tickservice;
     _statChangeFactory = statChangeFactory;
 }
Exemple #11
0
 public Ability2(UnitModel unit, WorldModel world, TickService tickService,
                 CommandProcessor commandProcessor, AbilityVariablesRegistry abilityVariablesRegistry, IFactory <IBuff, BuffData, BuffTargetCommand> buffTargetCommandFactory)
 {
     _unit = unit;
     _buffTargetCommandFactory = buffTargetCommandFactory;
     _world                    = world;
     _tickService              = tickService;
     _commandProcessor         = commandProcessor;
     _abilityVariablesRegistry = abilityVariablesRegistry;
     _abilityData              = _abilityVariablesRegistry [2];  //this is bad
 }
        public ProjectileManager(WorldModel worldModel, CommandProcessor commandProcessor,
                                 ProjectileRepository projectileRepository, TickService tickService,
                                 IFactory <IProjectile, RemoveProjectileCommand> removeProjectileFactory)
        {
            _worldModel              = worldModel;
            _projectileRepository    = projectileRepository;
            _tickService             = tickService;
            _commandProcessor        = commandProcessor;
            _removeProjectileFactory = removeProjectileFactory;

            _commandProcessor.AddCommand(this);
        }
Exemple #13
0
        public MakeProjectileAbility(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice, CommandProcessor command,
                                     ProjectileManager projectileManager

                                     )
        {
            _unit              = unit;
            _world             = world;
            _command           = command;
            _data              = new MakeArrowAbilityParams(data);
            _tickService       = tickservice;
            _projectileManager = projectileManager;
        }
Exemple #14
0
 public BuffAbility(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice, CommandProcessor command,
                    IFactory <IBuff, BuffData, BuffTargetCommand> buffFactory,
                    IFactory <StatChangeData, HPChangeCommand> HPChangeFactory)
 {
     _unit            = unit;
     _world           = world;
     _command         = command;
     _data            = new BuffAbilityParams(data);
     _tickService     = tickservice;
     _buffFactory     = buffFactory;
     _HPChangeFactory = HPChangeFactory;
 }
 public MovementAbility(UnitModel unit, AbilityData data, CommandProcessor command, TickService tick,
                        IFactory <UnitModel, ReviveCommand> reviveFactory,
                        IFactory <UnitModel, DieCommand> dieFactory,
                        IFactory <IStatChange, StatChangeData, StatChangeCommand> statChangeFactory)
 {
     _unit              = unit;
     _data              = data;
     _tick              = tick;
     _command           = command;
     _dieFactory        = dieFactory;
     _reviveFactory     = reviveFactory;
     _statChangeFactory = statChangeFactory;
 }
 public SpawnUnitsAbility(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice,
                          CommandProcessor command, UnitRegistry unitRegistry,
                          IFactory <IBuff, BuffData, BuffTargetCommand> buffFactory,
                          IFactory <StatChangeData, HPChangeCommand> HPChangeFactory,
                          IFactory <UnitData, AllianceType, WorldPosition, SpawnUnitCommand> spawnUnitCommandFactory)
 {
     _unit                    = unit;
     _world                   = world;
     _command                 = command;
     _data                    = new BuffAbilityParams(data);
     _tickService             = tickservice;
     _unitRegistry            = unitRegistry;
     _spawnUnitCommandFactory = spawnUnitCommandFactory;
 }
        public CommanderAbility2(UnitModel unit, AbilityData data, WorldModel world, TickService tickservice, CommandProcessor command,
                                 IFactory <IBuff, BuffData, BuffTargetCommand> buffFactory, AbilityRepository abilityRepository,

                                 IFactory <StatChangeData, HPChangeCommand> HPChangeFactory)
        {
            _unit              = unit;
            _world             = world;
            _command           = command;
            _data              = new BuffAbilityParams(data);
            _tickService       = tickservice;
            _buffFactory       = buffFactory;
            _HPChangeFactory   = HPChangeFactory;
            _abilityRepository = abilityRepository;

            _castTime     = data.castTime;
            _cooldownTime = data.cooldownTime;
        }
Exemple #18
0
 public override void OnShutdown()
 {
     TickService.RemoveUpdateCallback(OnUpdate);
     base.OnShutdown();
 }
Exemple #19
0
 public RootCommand(CCData cCData, TickService tick)
 {         //takes in this unit
     _cCData = cCData;
     _tick   = tick;
 }
Exemple #20
0
 public MovementAbility(UnitModel unit, AbilityData data, CommandProcessor command, TickService tick)
 {
     _unit = unit;
     _tick = tick;
 }
 public ReviveCommand(UnitModel unit, TickService tick)
 {         //takes in this unit
     _tick = tick;
     _unit = unit;
 }
 public DieCommand(StatChangeData data, TickService tick)
 {
     _tick       = tick;
     _damageData = data;
 }