示例#1
0
        public NetOutgoingMessage CreateGuiMessage(GuiComponentType gui)
        {
            NetOutgoingMessage m = IoCManager.Resolve <ISS14NetServer>().CreateMessage();

            m.Write((byte)NetMessage.PlayerUiMessage);
            m.Write((byte)UiManagerMessage.ComponentMessage);
            m.Write((byte)gui);
            return(m);
        }
        /// <summary>
        ///  Calls the custom Update Method for Components. This allows components to update ui elements if they implement the the needed method.
        /// </summary>
        public void ComponentUpdate(GuiComponentType componentType, params object[] args)
        {
            IGuiComponent firstOrDefault = (from IGuiComponent comp in _components
                                            where comp.ComponentClass == componentType
                                            select comp).FirstOrDefault();

            if (firstOrDefault != null)
            {
                firstOrDefault.ComponentUpdate(args);
            }
        }
 /// <summary>
 ///  Returns all components with matching GuiComponentType.
 /// </summary>
 public IEnumerable <IGuiComponent> GetComponentsByGuiComponentType(GuiComponentType componentType)
 {
     return(from IGuiComponent comp in _components
            where comp.ComponentClass == componentType
            select comp);
 }
 /// <summary>
 ///  Returns the first component with a matching GuiComponentType or null if none.
 /// </summary>
 public IGuiComponent GetSingleComponentByGuiComponentType(GuiComponentType componentType)
 {
     return((from IGuiComponent comp in _components
             where comp.ComponentClass == componentType
             select comp).FirstOrDefault());
 }
 public NetOutgoingMessage CreateGuiMessage(GuiComponentType gui)
 {
     NetOutgoingMessage m = IoCManager.Resolve<ISS14NetServer>().CreateMessage();
     m.Write((byte) NetMessage.PlayerUiMessage);
     m.Write((byte) UiManagerMessage.ComponentMessage);
     m.Write((byte) gui);
     return m;
 }
示例#6
0
 public override void ReadFromBuffer(NetIncomingMessage buffer)
 {
     UiType   = (UiManagerMessage)buffer.ReadByte();
     CompType = (GuiComponentType)buffer.ReadByte();
 }