/// <summary>
 /// A constructor used to set a single function to a mouse button.
 /// </summary>
 /// <param name="clickFunction"></param>
 /// <param name="leftClick">If true the function is set to the left click. If false the function is set to the right click.</param>
 public MouseButtonEvents(functionEvent clickFunction, bool leftClick)
 {
     if (leftClick == true)
     {
         this.onLeftClick = clickFunction;
     }
     else
     {
         this.onRightClick = clickFunction;
     }
 }
 /// <summary>
 /// A constructor used to map functions to mouse clicks and scrolling the mouse wheel.
 /// </summary>
 /// <param name="OnLeftClick">A function to be ran when the mouse left clicks this position.</param>
 /// <param name="OnRightClick">A function to be ran when the mouse right clicks this position.</param>
 /// <param name="OnMouseScroll">A function to be ran when the user scrolls the mouse</param>
 public MouseButtonEvents(functionEvent OnLeftClick, functionEvent OnRightClick, functionEvent OnMouseScroll)
 {
     this.onLeftClick   = OnLeftClick;
     this.onRightClick  = OnRightClick;
     this.onMouseScroll = OnMouseScroll;
 }
 /// <summary>
 /// A constructor used to map functions to mouse clicks.
 /// </summary>
 /// <param name="OnLeftClick">A function to be ran when the mouse left clicks this position.</param>
 /// <param name="OnRightClick">A function to be ran when the mouse right clicks this position.</param>
 public MouseButtonEvents(functionEvent OnLeftClick, functionEvent OnRightClick)
 {
     this.onLeftClick  = OnLeftClick;
     this.onRightClick = OnRightClick;
 }
 /// <summary>Construct an instance.</summary>
 /// <param name="OnPlayerEnter">Occurs when the player enters the same tile as this event.</param>
 /// <param name="OnPlayerLeave">Occurs when the player leaves the same tile as this event.</param>
 public PlayerEvents(functionEvent OnPlayerEnter, functionEvent OnPlayerLeave)
 {
     this.onPlayerEnter = OnPlayerEnter;
     this.onPlayerLeave = OnPlayerLeave;
 }
Exemple #5
0
 /// <summary>Construct an instance.</summary>
 /// <param name="OnMouseEnter">The function that occurs when the mouse enters a certain position.</param>
 /// <param name="OnMouseLeave">The function that occurs when the mouse leaves a certain position.</param>
 public MouseEntryLeaveEvent(functionEvent OnMouseEnter, functionEvent OnMouseLeave)
 {
     this.onMouseEnter = OnMouseEnter;
     this.onMouseLeave = OnMouseLeave;
 }