Esempio n. 1
0
 public Sandbox_Module(BaseClass_ModuleExecutionSystem exSystem) : base(exSystem)
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor from nothing, linking execution system
 /// </summary>
 /// <param name="modExeSys">Execution System to which this module belongs and from which it executes</param>
 public BaseClass_Module(BaseClass_ModuleExecutionSystem modExeSys)
 {
     modExeSys.linkModuleObj(this);
     ExeSysLink = modExeSys;
 }
Esempio n. 3
0
 public Interface_Module(BaseClass_ModuleExecutionSystem exSystem) : base(exSystem)
 {
 }
Esempio n. 4
0
 public ExeSys_Module(BaseClass_ModuleExecutionSystem exSystem) : base(exSystem)
 {
 }
        public static List <BaseClass_Packet> ParsePackets(SerializationType DeSerializationTypeSelect, List <byte> bytes2Parse)
        {
            BaseClass_Packet        DeserializedPacket = null;
            List <BaseClass_Packet> outPacks           = null;

            switch (DeSerializationTypeSelect)
            {
            case SerializationType.text_JSON:
            {
                int openIndex  = 0;
                int closeIndex = 0;
                int openDepth  = 0;
                int byteLength = 0;
                for (int i = 0; i < bytes2Parse.Count; i++)
                {
                    if (bytes2Parse[i] == jsonOpenDelim)
                    {
                        openDepth++;
                        if (openDepth == 1)
                        {
                            openIndex = i;
                        }
                    }
                    else if (bytes2Parse[i] == jsonCloseDelim)
                    {
                        openDepth--;

                        if (openDepth == 0)
                        {
                            closeIndex = i;
                            byteLength = closeIndex - openIndex + 1;
                            byte[] packetTokenBytes = bytes2Parse.GetRange(openIndex, byteLength).ToArray();
                            if (byteLength > 2)
                            {
                                if (DeSerializeDefaultPacket(ref packetTokenBytes, DeSerializationTypeSelect, out DeserializedPacket))
                                {
                                    if (outPacks == null)
                                    {
                                        outPacks = new List <BaseClass_Packet>();
                                    }
                                    outPacks.Add(DeserializedPacket);
                                }
                                else if (BaseClass_ModuleExecutionSystem.DeSerializeKnownPacket(ref packetTokenBytes, DeSerializationTypeSelect, ref DeserializedPacket))
                                {
                                    if (outPacks == null)
                                    {
                                        outPacks = new List <BaseClass_Packet>();
                                    }
                                    outPacks.Add(DeserializedPacket);
                                }
                                else
                                {
                                    if (outPacks == null)
                                    {
                                        outPacks = new List <BaseClass_Packet>();
                                    }
                                    outPacks.Add(new UnknownPacket_2 {
                                            UnknownBytes = packetTokenBytes
                                        });
                                }
                            }
                        }
                    }
                }
            }
            break;

            default: throw new NotImplementedException("De-Serialization types other than text JSON are not yet supported.");
            }
            return(outPacks);
        }
 public ExeSysException(BaseClass_ModuleExecutionSystem exeSysIn, String msgIn, Exception excpIn) : base(msgIn, excpIn)
 {
 }
 public ExeSysException(BaseClass_ModuleExecutionSystem exeSysIn, String msgIn) : base(msgIn)
 {
     ExeSysLink = exeSysIn;
 }