Ejemplo n.º 1
0
        private static EventResponseType NormalizeResponseType(EventResponseType responseType)
        {
            if (!Enum.IsDefined(typeof(EventResponseType), responseType) || responseType <= EventResponseType.None)
            {
                responseType = EventResponseType.No;
            }

            return(responseType);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlatformerPro.EventResponse"/> class by cloning another instance.
 /// </summary>
 /// <param name="original">Original.</param>
 public EventResponse(EventResponse original)
 {
     this.responseType     = original.responseType;
     this.delay            = original.delay;
     this.targetGameObject = original.targetGameObject;
     this.targetComponent  = original.targetComponent;
     this.overrideState    = original.overrideState;
     this.message          = original.message;
     this.newSprite        = original.newSprite;
 }
        public EventResponse(Event SourceEvent, Object ResponseSource, Object ResponseObject, DateTime ResponseTime, String ResponseMessage, EventResponseType ResponseType)
            : this(SourceEvent)
        {
            this.ResponseSource  = ResponseSource;
            this.ResponseObject  = ResponseObject;
            this.ResponseTime    = ResponseTime;
            this.ResponseMessage = ResponseMessage;
            this.ResponseType    = ResponseType;

            return;
        }
        public ActionResult EventSidebar(int eventId, EventResponseType responseType)
        {
            if (CurrentMemberModel == null)
            {
                return(RedirectToCurrentUmbracoPage());
            }

            IPublishedContent content = Umbraco.TypedContent(eventId);
            EventModel        @event  = _eventService.GetEvent(content);

            if (_eventService.IsTicketedEvent(@event))
            {
                return(RedirectToCurrentUmbracoPage());
            }

            _eventService.UpdateEventResponse(Umbraco.TypedContent(eventId), CurrentMember, responseType);

            return(EventSidebarView(eventId));
        }
        public Dictionary <EventResponseType, IReadOnlyCollection <MemberModel> > GetEventResponses(int eventId, UmbracoHelper helper)
        {
            IReadOnlyCollection <EventResponse> responses = _eventDataService.GetEventResponses(eventId);

            Dictionary <EventResponseType, List <MemberModel> > dictionary = new Dictionary <EventResponseType, List <MemberModel> >();

            foreach (EventResponse response in responses)
            {
                EventResponseType responseType = (EventResponseType)response.ResponseTypeId;
                if (!dictionary.ContainsKey(responseType))
                {
                    dictionary.Add(responseType, new List <MemberModel>());
                }

                IPublishedContent member = helper.TypedMember(response.MemberId);
                if (member != null)
                {
                    MemberModel memberModel = new MemberModel(member);
                    dictionary[responseType].Add(memberModel);
                }
            }

            return(dictionary.ToDictionary(x => x.Key, x => (IReadOnlyCollection <MemberModel>)x.Value.ToArray()));
        }
        public void UpdateEventResponse(IPublishedContent @event, IPublishedContent member, EventResponseType responseType)
        {
            if (@event == null)
            {
                return;
            }

            if (!Enum.IsDefined(typeof(EventResponseType), responseType) || responseType == EventResponseType.None)
            {
                return;
            }

            EventModel eventModel = GetEvent(@event);

            if (eventModel.Date == DateTime.MinValue)
            {
                return;
            }

            _eventDataService.UpdateEventResponse(new EventResponse
            {
                EventId        = @event.Id,
                MemberId       = member.Id,
                ResponseTypeId = (int)responseType
            });
        }
Ejemplo n.º 7
0
 public EventResponse(Guid eventId, Guid memberId, EventResponseType responseTypeId)
 {
     EventId        = eventId;
     MemberId       = memberId;
     ResponseTypeId = responseTypeId;
 }
Ejemplo n.º 8
0
        public async Task <EventResponse> UpdateMemberResponse(Guid memberId, Guid eventId, EventResponseType responseType)
        {
            responseType = NormalizeResponseType(responseType);

            Event @event = await GetEvent(memberId, eventId);

            if (@event.Date < DateTime.Today)
            {
                throw new OdkServiceException("Past events cannot be responded to");
            }

            EventResponse response = new EventResponse(eventId, memberId, responseType);
            await _eventRepository.UpdateEventResponse(response);

            return(new EventResponse(eventId, memberId, responseType));
        }
Ejemplo n.º 9
0
        public async Task <EventResponseApiResponse> Respond(Guid id, EventResponseType type)
        {
            EventResponse response = await _eventService.UpdateMemberResponse(GetMemberId(), id, type);

            return(_mapper.Map <EventResponseApiResponse>(response));
        }
 public EventResponse(Event SourceEvent, Object ResponseSource, EventResponseType ResponseType)
     : this(SourceEvent, ResponseSource, null, DateTime.Now, String.Empty, ResponseType)
 {
 }
        public static string GetName(this EventResponseType me)
        {
            switch (me)
            {
            case EventResponseType.DEBUG_LOG: return("General/Debug Log");

            case EventResponseType.SEND_MESSSAGE: return("General/Send Message");

            case EventResponseType.ACTIVATE_GAMEOBJECT: return("Activation/Activate GameObject");

            case EventResponseType.ACTIVATE_GAMEOBJECT_AT_POSITION: return("Activation/Activate GameObject At Position");

            case EventResponseType.DEACTIVATE_GAMEOBJECT: return("Activation/Deactivate GameObject");

            case EventResponseType.ENABLE_BEHAVIOUR: return("Activation/Enable Behaviour");

            case EventResponseType.DISABLE_BEHAVIOUR: return("Activation/DisableBehaviour");

            case EventResponseType.INSTANTIATE_AT_POSITION: return("Activation/Instantiate At Position");

            case EventResponseType.OVERRIDE_ANIMATON: return("Animation/Animation Override");

            case EventResponseType.CLEAR_ANIMATION_OVERRIDE: return("Animation/Clear Animation Override");

            case EventResponseType.PLAY_ANIMATION: return("Animation/Play Animation");

            case EventResponseType.STOP_ANIMATION: return("Animation/Stop Animation");

            case EventResponseType.SWITCH_SPRITE: return("Animation/Switch Sprite");

            case EventResponseType.PLAY_PARTICLES: return("Effects/Particles/Play Particles");

            case EventResponseType.PAUSE_PARTICLES: return("Effects/Particles/Pause Particles");

            case EventResponseType.START_EFFECT: return("Effects/FX System/Start Effect");

            case EventResponseType.PLAY_SFX: return("Effects/Sound/Play SFX");

            case EventResponseType.PLAY_SONG: return("Effects/Sound/Play Song");

            case EventResponseType.STOP_SONG: return("Effects/Sound/Stop Song");

            case EventResponseType.MAKE_INVULNERABLE: return("Character/Health/Make Invulnerable");

            case EventResponseType.MAKE_VULNERABLE: return("Character/Health/Make Vulnerable");

            case EventResponseType.HEAL: return("Character/Health/Heal");

            case EventResponseType.DAMAGE: return("Character/Health/Damage");

            case EventResponseType.KILL: return("Character/Health/Kill");

            case EventResponseType.ADD_LIVES: return("Character/Health/Add (or Remove) Lives");

            case EventResponseType.UPDATE_MAX_HEALTH: return("Character/Health/Add (or Remove) Max Health");

            case EventResponseType.SET_MAX_HEALTH: return("Character/Health/Set Max Health");

            case EventResponseType.UPDATE_MAX_LIVES: return("Character/Health/Add (or Remove) Max Lives");

            case EventResponseType.SET_MAX_LIVES: return("Character/Health/Set Max Lives");

            case EventResponseType.START_SWIM: return("Character/Movement/Start Swim");

            case EventResponseType.STOP_SWIM: return("Character/Movement/Stop Swim");

            case EventResponseType.SWIM_SURFACE: return("Character/Movement/Swim On Surface");

            case EventResponseType.ADD_VELOCITY: return("Character/Movement/Add Velocity");

            case EventResponseType.SET_VELOCITY: return("Character/Movement/Set Velocity");

            case EventResponseType.SET_TAGGED_PROPERTY: return("Character/Tagged Properties/Set Tagged property");

            case EventResponseType.ADD_TO_TAGGED_PROPERTY: return("Character/Tagged Properties/Add to Tagged Properery");

            case EventResponseType.MULTIPLY_TAGGED_PROPERTY: return("Character/Tagged Properties/Multiply Tagged Property");

            case EventResponseType.SPECIAL_MOVE_ANIMATION: return("Animation/Special Move Animation");

            case EventResponseType.COLLECT_ITEM: return("Character/Items/Collect Item");

            case EventResponseType.CONSUME_ITEM: return("Character/Items/Consume Item");

            case EventResponseType.SET_ITEM_MAX: return("Character/Items/Set Item Max");

            case EventResponseType.UPDATE_ITEM_MAX: return("Character/Items/Update Item Max");

            case EventResponseType.POWER_UP: return("Character/Power-Up/Grant Power-Up");

            case EventResponseType.RESET_POWER_UP: return("Character/Power-Up/Reset Power-Up");

            case EventResponseType.SPAWN_ITEM: return("Spawner/Spawn Item");

            case EventResponseType.SET_DEPTH: return("Character/Special/Set Depth");

            case EventResponseType.FLIP_GRAVITY: return("Character/Special/Flip Gravity");

            case EventResponseType.TELEPORT: return("Character/Special/Teleport");

            case EventResponseType.RESPAWN: return("Character/Respawn/Respawn");

            case EventResponseType.LEVEL_COMPLETE: return("Level/Level Complete");

            case EventResponseType.LOAD_SCENE: return("Level/Load Scene");

            case EventResponseType.LOCK: return("Level/Lock Level");

            case EventResponseType.UNLOCK: return("Level/Unlock Level");

            case EventResponseType.SET_ACTIVE_RESPAWN: return("Level/Set Active Respawn");

            case EventResponseType.ADD_SCORE: return("Score/Add Score");

            case EventResponseType.RESET_SCORE: return("Score/Reset Score");

            case EventResponseType.ACTIVATE_ITEM: return("Activation Group/Activate");

            case EventResponseType.DEACTIVATE_ITEM: return("Activation Group/Deactivate");
            }
            return("Other/" + me);
        }
 public static string GetDescription(this EventResponseType me)
 {
     return("");
 }