public List <EventConfigData> GetAvailableEvents()
        {
            // If no events - return the empty list
            if (_nextEvents.Count == 0)
            {
                return(_nextEvents);
            }

            // Currently we only support one concurrent event
            EventConfigData nextEvent = _nextEvents[0];

            // Check if the event has ended and populate next events list:
            if (nextEvent.endTime < Now)
            {
                logger.Log(Tag, "Event ended : " + nextEvent.id);
                eventEndedSignal.Dispatch(nextEvent.id);

                PopulateNextEvents();
            }

            // Quick retreval of the next event (using a shallow copy, no performance overhead - can be used in an update loop)
            if (_nextEvents.Count > 0 && nextEvent.startTime < Now)
            {
                return(_nextEvents.GetRange(0, 1));
            }
            else
            {
                return(_nextEvents.GetRange(0, 0));
            }
        }
예제 #2
0
 protected override void Start()
 {
     base.Start();
     _currentEventData   = currentEventData [0];
     _availableEventData = availableEventData [0];
     SetBannerForEvent();
 }
예제 #3
0
        protected override void Start()
        {
            base.Start();

            eventData = eventSystemService.GetAvailableEvents().First();

            List <AssetData> assetData = eventConfigModel.GetAssets(eventData.id);

            StartCoroutine(SetBanner(assetData[0], bannerImage));
            StartCoroutine(SetBanner(assetData[1], prizeImage));
        }
예제 #4
0
        public IConfigData Clone()
        {
            EventConfigData c = new EventConfigData();

            c.id                = id;
            c.name              = name;
            c.description       = description;
            c.objectiveId       = objectiveId;
            c.startTime         = startTime;
            c.endTime           = endTime;
            c.levels            = new List <string>(levels.Clone());
            c.affinityItems     = new List <string>(affinityItems.Clone());
            c.rankPrizes        = new List <EventPrizeData>(rankPrizes.Clone());
            c.progressionPrizes = new List <EventPrizeData>(progressionPrizes.Clone());
            c.assets            = new List <AssetData>(assets.Clone());
            c.properties        = new List <GenericPropertyData>(properties.Clone());

            return(c);
        }
 private void Start()
 {
     base.Start();
     _availableEventData = availableEventData [0];
 }