Пример #1
0
 public CameraEventData(string id, object sender, EventActionType eventType,
                        EventCategoryType eventCategoryType, string cameraLayout, string cameraID)
     : base(id, sender, eventType, eventCategoryType)
 {
     this.cameraLayout = cameraLayout;   //e.g. fullscreen?
     this.cameraID     = cameraID;       //e.g. first person collidable
 }
 public EventData(string id, object sender, EventActionType eventType, EventCategoryType eventCategoryType)
 {
     this.id                = id;                //id of sender
     this.sender            = sender;            //object reference of sender
     this.eventType         = eventType;         //is it play, mute, volume, zone?
     this.eventCategoryType = eventCategoryType; //where did it originate? ui, menu, video
 }
Пример #3
0
 public UserEvent(DateTime timestamp, EventCategoryType category, string title, string body)
 {
     this.Timestamp = timestamp;
     this.Category  = category;
     this.Title     = title;
     this.Body      = body;
 }
Пример #4
0
 public DeviceEvent(DateTime timestamp, EventCategoryType category, string title, string body, bool receivedFromDevice = false)
 {
     this.Timestamp          = timestamp;
     this.Category           = category;
     this.Title              = title;
     this.Body               = body;
     this.ReceivedFromDevice = receivedFromDevice;
 }
 public EventData(string id,
     object sender, EventType eventType, EventCategoryType eventCategoryType)
 {
     this.id = id;
     this.sender = sender;
     this.eventType = eventType;
     this.eventCategoryType = eventCategoryType;
 }
 //never used - notice it is private
 private SoundEventData(string id, object sender, EventActionType eventType,
                        EventCategoryType eventCategoryType, string cueName, AudioStopOptions audioStopOptions, AudioEmitter audioEmitter)
     : base(id, sender, eventType, eventCategoryType)
 {
     this.cueName          = cueName; //"boing
     this.audioStopOptions = audioStopOptions;
     this.audioEmitter     = audioEmitter;
 }
Пример #7
0
 public UiOptionsEvent(EventCategoryType eventCategoryType, IActor parent, Texture2D textureEasy,
                       Texture2D textureHard) : base(eventCategoryType, parent)
 {
     uiButtonObject   = parent as UIButtonObject;
     this.textureEasy = textureEasy;
     this.textureHard = textureHard;
     EventManager.RegisterListener <OptionsEventInfo>(HandleEvent);
 }
Пример #8
0
        public static void Subscribe(EventCategoryType eventCategoryType, EventHandlerDelegate del)
        {
            if (!dictionary.ContainsKey(eventCategoryType))
            {
                dictionary.Add(eventCategoryType, new List <EventHandlerDelegate>());
            }

            dictionary[eventCategoryType].Add(del);
        }
Пример #9
0
        //supports passing of multiple parameter objects within an event
        public EventData(string id, object sender, EventActionType eventType, EventCategoryType eventCategoryType, object[] additionalParameters)
        {
            this.id                = id;                //id of sender
            this.sender            = sender;            //object reference of sender
            this.eventType         = eventType;         //is it play, mute, volume, zone?
            this.eventCategoryType = eventCategoryType; //where did it originate? ui, menu, video

            //used to pass extra information between sender and registered recipient(s)
            this.additionalParameters = additionalParameters;
        }
 public static bool Unsubscribe(EventCategoryType eventCategoryType, EventHandlerDelegate del)
 {
     if (dictionary.ContainsKey(eventCategoryType))
     {
         List <EventHandlerDelegate> list = dictionary[eventCategoryType];
         list.Remove(del);
         return(true);
     }
     return(false);
 }
Пример #11
0
 public UiCoffeeWarningEventHandler(EventCategoryType eventCategoryType, IActor parent,
                                    Texture2D textureToSwitch) : base(eventCategoryType, parent)
 {
     this.textureToSwitch = textureToSwitch;
     uiTextureObject      = parent as UITextureObject;
     if (uiTextureObject != null)
     {
         initialTexture = uiTextureObject.Texture;
     }
     EventManager.RegisterListener <CoffeeEventInfo>(HandleEvent);
 }
        public static void Subscribe(EventCategoryType eventCategoryType, EventHandlerDelegate del)
        {
            if (dictionary == null)
            {
                throw new Exception("Have you initialized the EventDispatcher before calling Subscribe?");
            }

            if (!dictionary.ContainsKey(eventCategoryType))
            {
                dictionary.Add(eventCategoryType, new List <EventHandlerDelegate>());
            }

            dictionary[eventCategoryType].Add(del);
        }
Пример #13
0
 //when we don't have any pertinent string data in ID AND sender
 public EventData(EventActionType eventType, EventCategoryType eventCategoryType)
     : this(null, null, eventType, eventCategoryType, null)
 {
 }
 public TextEventData(string id, object sender, EventActionType eventActionType, EventCategoryType eventCategoryType, SpriteFont font, string text, Color textColor, Color backgroundColor)
     : base(id, sender, eventActionType, eventCategoryType)
 {
     this.text            = text; //e.g. alarm in sector 2
     this.font            = font;
     this.textColor       = textColor;
     this.backgroundColor = backgroundColor;
 }
 //used when we wish to specify a camera to be set as active
 public VideoEventData(string id, object sender, EventActionType eventActionType, EventCategoryType eventCategoryType, string name)
     : base(id, sender, eventActionType, eventCategoryType)
 {
     this.name = name;       //e.g. target video name to play/pause/restart
 }
 public ARVREvent(EventCategoryType eventCategoryType,
                  EventActionType eventActionType)
 {
     EventCategoryType = eventCategoryType;
     EventActionType   = eventActionType;
 }
Пример #17
0
 public PlayerSpawnEventHandler(EventCategoryType eventCategoryType, IActor parent)
     : base(eventCategoryType, parent)
 {
 }
Пример #18
0
 //pre-object[] compatability constructor
 public EventData(string id, object sender, EventActionType eventType, EventCategoryType eventCategoryType)
     : this(id, sender, eventType, eventCategoryType, null)
 {
 }
 //use when you want to play a 3D sound
 public SoundEventData(string id, object sender, EventActionType eventType,
                       EventCategoryType eventCategoryType, string cueName, AudioEmitter audioEmitter)
     : this(id, sender, eventType, eventCategoryType, cueName, AudioStopOptions.Immediate, audioEmitter)
 {
 }
        public override int GetHashCode()
        {
            int seed = 31;

            return(EventCategoryType.GetHashCode() + seed * EventActionType.GetHashCode());
        }
Пример #21
0
 //when we don't have any pertinent string data in ID AND sender but have additional event parameters
 public EventData(EventActionType eventType, EventCategoryType eventCategoryType, object[] additionalParameters)
     : this(null, null, eventType, eventCategoryType, additionalParameters)
 {
 }
Пример #22
0
 //when we don't have any pertinent string data in ID
 public EventData(object sender, EventActionType eventType, EventCategoryType eventCategoryType)
     : this(null, sender, eventType, eventCategoryType, null)
 {
 }
 //use when you want to stop a 2D OR 3D sound
 public SoundEventData(string id, object sender, EventActionType eventType,
                       EventCategoryType eventCategoryType, string cueName, AudioStopOptions audioStopOptions)
     : this(id, sender, eventType, eventCategoryType, cueName, audioStopOptions, null)
 {
 }