using System; using Woodpecker.Sessions; using Woodpecker.Net.Game; using Woodpecker.Net.Game.Messages; namespace Woodpecker.Game { /// /// The root class of all *Reactor objects, containing the element parts of a reactor who are inherited in every reactor. This class is partial, the other part is inside reactorGenericMethods.cs /// public partial class Reactor { #region Properties /// /// The Session object to use by listeners in this reactor. /// protected Session Session; /// /// The clientMessage object, which contains the last sent message by the client. /// protected clientMessage Request; /// /// The serverMessage object, which will contain response messages before being sent to the client. /// protected serverMessage Response = new serverMessage(); #endregion #region Methods /// /// Sends the current serverMessage object as a response and resets the response object. /// public void sendResponse() { this.Session.gameConnection.sendMessage(this.Response); this.Response = new serverMessage(); } /// /// Sets the Woodpecker.Sessions.Session object for this reactor. /// /// The Woodpecker.Sessions.Session to set. public void setSession(Session Session) { this.Session = Session; } /// /// Nulls the Woodpecker.Sessions.Session object for this reactor. /// public void unsetRequest() { this.Request = null; } /// /// Sets the current request (Woodpecker.Net.Game.Messages.clientMessage) to this reactor. /// /// The last sent Woodpecker.Net.Game.Messages.clientMessage. public void setRequest(clientMessage Request) { this.Request = Request; } #endregion } }