예제 #1
0
 public ButtonCluster(IClusterButtonAnimationFactory animationFactory, IWrapper wrapper, IAddOnRegistry addOnRegistry)
 {
     this.animationFactory = animationFactory;
     this.wrapper          = wrapper;
     this.addOnRegistry    = addOnRegistry;
     this.lastActive       = 0;
     this.buttons          = new List <RoundButton>();
     this.SetUpMainButton();
 }
예제 #2
0
        public ModelProvider(ISerializer serializer, IWrapper wrapper, GameEventListener eventListener, IAddOnRegistry addOnRegistry, QuickButtonModule buttonModule)
        {
            var subscriptionCenter = new EntityUpdateSubscriptionCenter <Profile, string>();

            this.AccountProfiles = new EntityStore <Profile, string>(serializer, new SavedDataHandler(SavedAccountProfiles, Global.Api.GetRealmName()), subscriptionCenter);

            eventListener.RegisterEvent(SystemEvent.VARIABLES_LOADED, this.OnVariablesLoaded);
            addOnRegistry.RegisterAddOn(AddOnReference.GHF);

            var playerName      = Global.Api.UnitName(UnitId.player);
            var version         = Global.Api.GetAddOnMetadata(Strings.tostring(AddOnReference.GH), "Version");
            var supportedFields = new SupportedFields();

            this.Msp = new MSPProxy(new ProfileFormatter(), version, supportedFields, wrapper);

            subscriptionCenter.SubscribeForUpdates(this.Msp.Set, profile => profile.Id.Equals(playerName));

            var requestStrategy = new MspRequestStrategy();
            var activityScanner = new PlayerActivityScanner((name, activity) => { this.Msp.Request(name, requestStrategy.GetFieldsToRequest(activity)); }, eventListener);

            new Presenter(this, supportedFields, buttonModule);
        }