示例#1
0
        private static object tryGetCommonField(ref Memories MemoryHaystack, String KeyS, KeyWord KeyK, Memory.MemoryComponents InPart, Memory.MemoryComponents OutPart)
        {
            Memory MemoryNeedle = new Memory(KeyS, KeyK, String.Empty, null);

            foreach (Memory Memory in MemoryHaystack)
            {
                switch (InPart)
                {
                case Memory.MemoryComponents.KEY:
                    if (!Object.Equals(null, KeyK))
                    {
                        if (KeyK != KeyWord.NIL)
                        {
                            if (compare(Memory, MemoryNeedle, InPart))
                            {
                                return(get(Memory, OutPart));
                            }
                        }
                    }
                    if (!Object.Equals(null, KeyS))
                    {
                        if (KeyS != String.Empty)
                        {
                            if (compare(Memory, MemoryNeedle, InPart))
                            {
                                return(get(Memory, OutPart));
                            }
                        }
                    }
                    break;

                case Memory.MemoryComponents.NAME:
                    if (!Object.Equals(null, KeyK))
                    {
                        if (KeyK != KeyWord.NIL)
                        {
                            if (compare(Memory, MemoryNeedle, InPart))
                            {
                                return(get(Memory, OutPart));
                            }
                        }
                    }
                    if (!Object.Equals(null, KeyS))
                    {
                        if (KeyS != String.Empty)
                        {
                            if (compare(Memory, MemoryNeedle, InPart))
                            {
                                return(get(Memory, OutPart));
                            }
                        }
                    }
                    break;
                }
            }
            return(null);
        }
示例#2
0
 internal Event(String Source_FullyQualifiedName, KeyWord KeyWord, Memories Memories, Double WhenSent, Double WhenRcvd, KeyWord Importance, KeyWord DeliveryState, EventTransfer IntendedRecipients)
 {
     _Source_FullyQualifiedName = Source_FullyQualifiedName;
     _DeliveryState = DeliveryState;
     _Importance = Importance;
     _Keyword = KeyWord;
     _Memories = Memories;
     _WhenSent = WhenSent;
     _WhenRcvd = WhenRcvd;
     _IntendedRecipients = IntendedRecipients;
 }
示例#3
0
 internal Event(String Source_FullyQualifiedName, KeyWord KeyWord, Memories Memories, Double WhenSent, Double WhenRcvd, KeyWord Importance, KeyWord DeliveryState, EventTransfer IntendedRecipients)
 {
     _Source_FullyQualifiedName = Source_FullyQualifiedName;
     _DeliveryState             = DeliveryState;
     _Importance         = Importance;
     _Keyword            = KeyWord;
     _Memories           = Memories;
     _WhenSent           = WhenSent;
     _WhenRcvd           = WhenRcvd;
     _IntendedRecipients = IntendedRecipients;
 }
示例#4
0
 public Event(SerializationInfo info, StreamingContext ctxt)
 {
     _IntendedRecipients = (EventTransfer)info.GetValue("_IntendedRecipients", typeof(eventScope));
     _WhenSent = (Double)info.GetValue("_WhenSent", typeof(Double));
     _WhenRcvd = (Double)info.GetValue("_WhenRcvd", typeof(Double));
     _Importance = (KeyWord)info.GetValue("_Importance", typeof(KeyWord));
     _Memories = (Memories)info.GetValue("_Memories", typeof(Memories));
     _Keyword = (KeyWord)info.GetValue("_Keyword", typeof(KeyWord));
     _DeliveryState = (KeyWord)info.GetValue("_DeliveryState", typeof(KeyWord));
     _Source_FullyQualifiedName = (String)info.GetValue("_Source_FullyQualifiedName", typeof(String));
     _Endpoint = (String)info.GetValue("_Endpoint", typeof(String));
 }
示例#5
0
        public void preventMousePick(string name)
        {
            Memories mems = new Memories();

            mems.Add(new Memory("Name", KeyWord.NIL, name, null));
            Event ev = new Event();

            ev._Keyword            = KeyWord.PREVENTMOUSEPICK;
            ev._Memories           = mems;
            ev._IntendedRecipients = EventTransfer.CLIENTTOCLIENT;
            this.outboxMessage(this, ev);
        }
示例#6
0
 public Event(SerializationInfo info, StreamingContext ctxt)
 {
     _IntendedRecipients        = (EventTransfer)info.GetValue("_IntendedRecipients", typeof(eventScope));
     _WhenSent                  = (Double)info.GetValue("_WhenSent", typeof(Double));
     _WhenRcvd                  = (Double)info.GetValue("_WhenRcvd", typeof(Double));
     _Importance                = (KeyWord)info.GetValue("_Importance", typeof(KeyWord));
     _Memories                  = (Memories)info.GetValue("_Memories", typeof(Memories));
     _Keyword                   = (KeyWord)info.GetValue("_Keyword", typeof(KeyWord));
     _DeliveryState             = (KeyWord)info.GetValue("_DeliveryState", typeof(KeyWord));
     _Source_FullyQualifiedName = (String)info.GetValue("_Source_FullyQualifiedName", typeof(String));
     _Endpoint                  = (String)info.GetValue("_Endpoint", typeof(String));
 }
示例#7
0
        public static bool tryGetCommonField(ref Memories Memories, String KeyS, KeyWord KeyK, System.Type OutValueType, Memory.MemoryComponents InPart, Memory.MemoryComponents OutPart, ref object outVar)
        {
            try
            {
                //lock (Memories)
                //{
                String TYPE_STRING    = typeof(System.String).ToString();
                String TYPE_INT       = typeof(System.Int32).ToString();
                String TYPE_BOOL      = typeof(System.Boolean).ToString();
                String TYPE_KEYWORD   = typeof(KeyWord).ToString();
                String OUT_VALUE_TYPE = OutValueType.ToString();

                Object o = null;
                // lock (Memories)
                // {
                o = tryGetCommonField(ref Memories, KeyS, KeyK, InPart, OutPart);
                // }

                string s = String.Empty;
                if (object.Equals(null, o))
                {
                    return(false);
                }
                if (OUT_VALUE_TYPE == TYPE_STRING)
                {
                    s      = (String)o;
                    outVar = s;
                    return(true);
                }
                else if (OUT_VALUE_TYPE == TYPE_BOOL)
                {
                    s = (String)o;
                    if (s != String.Empty)
                    {
                        outVar = Boolean.Parse(s);
                        return(true);
                    }
                    else
                    {
                        outVar = false;
                        return(false);
                    }
                }
                else if (OUT_VALUE_TYPE == TYPE_INT)
                {
                    s = (String)o;
                    if (s != String.Empty)
                    {
                        outVar = System.Int32.Parse(s);
                        return(true);
                    }
                    else
                    {
                        outVar = 0;
                        return(false);
                    }
                }
                else if (OUT_VALUE_TYPE == TYPE_KEYWORD)
                {
                    outVar = (KeyWord)o;
                    return(true);
                }
                else
                {
                    outVar = null;
                    return(false);
                }
                //}
            }
            catch //(Exception e)
            {
                // _Log(e.ToString());
                return(false);
            }
        }
 private void sendLocationBeacon(Mogre.Vector3 pos)
 {
     Memories mems = new Memories();
     mems.Add(new Memory("", KeyWord.CARTESIAN_X, pos.x.ToString(), null));
     mems.Add(new Memory("", KeyWord.CARTESIAN_Y, pos.y.ToString(), null));
     mems.Add(new Memory("", KeyWord.CARTESIAN_Z, pos.z.ToString(), null));
     Event ev = new Event();
     ev._Keyword = KeyWord.CARTESIAN_SECRETPLAYERLOCATION;
     ev._Memories = mems;
     ev._IntendedRecipients = EventTransfer.CLIENTTOSERVER;
     base.outboxMessage(this, ev);
     // log("Location: X=" + imAt.x.ToString() + " Y=" + imAt.y.ToString() + " Z=" + imAt.z.ToString());
 }
示例#9
0
 public void preventMousePick(string name)
 {
     Memories mems = new Memories();
     mems.Add(new Memory("Name", KeyWord.NIL, name, null));
     Event ev = new Event();
     ev._Keyword = KeyWord.PREVENTMOUSEPICK;
     ev._Memories = mems;
     ev._IntendedRecipients = EventTransfer.CLIENTTOCLIENT;
     this.outboxMessage(this, ev);
 }
示例#10
0
 private static object tryGetCommonField(ref Memories MemoryHaystack, String KeyS, KeyWord KeyK, Memory.MemoryComponents InPart, Memory.MemoryComponents OutPart)
 {
     Memory MemoryNeedle = new Memory(KeyS, KeyK, String.Empty, null);
     foreach (Memory Memory in MemoryHaystack)
     {
         switch (InPart)
         {
             case Memory.MemoryComponents.KEY:
                 if (!Object.Equals(null, KeyK))
                 {
                     if (KeyK != KeyWord.NIL)
                     {
                         if (compare(Memory, MemoryNeedle, InPart))
                         {
                             return get(Memory, OutPart);
                         }
                     }
                 }
                 if (!Object.Equals(null, KeyS))
                 {
                     if (KeyS != String.Empty)
                     {
                         if (compare(Memory, MemoryNeedle, InPart))
                         {
                             return get(Memory, OutPart);
                         }
                     }
                 }
                 break;
             case Memory.MemoryComponents.NAME:
                 if (!Object.Equals(null, KeyK))
                 {
                     if (KeyK != KeyWord.NIL)
                     {
                         if (compare(Memory, MemoryNeedle, InPart))
                         {
                             return get(Memory, OutPart);
                         }
                     }
                 }
                 if (!Object.Equals(null, KeyS))
                 {
                     if (KeyS != String.Empty)
                     {
                         if (compare(Memory, MemoryNeedle, InPart))
                         {
                             return get(Memory, OutPart);
                         }
                     }
                 }
                 break;
         }
     }
     return null;
 }
示例#11
0
        public static bool tryGetCommonField(ref Memories Memories, String KeyS, KeyWord KeyK, System.Type OutValueType, Memory.MemoryComponents InPart, Memory.MemoryComponents OutPart, ref object outVar)
        {
            try
            {
                //lock (Memories)
                //{
                String TYPE_STRING = typeof(System.String).ToString();
                String TYPE_INT = typeof(System.Int32).ToString();
                String TYPE_BOOL = typeof(System.Boolean).ToString();
                String TYPE_KEYWORD = typeof(KeyWord).ToString();
                String OUT_VALUE_TYPE = OutValueType.ToString();

                Object o = null;
                // lock (Memories)
                // {
                o = tryGetCommonField(ref Memories, KeyS, KeyK, InPart, OutPart);
                // }

                string s = String.Empty;
                if (object.Equals(null, o))
                {
                    return false;
                }
                if (OUT_VALUE_TYPE == TYPE_STRING)
                {
                    s = (String)o;
                    outVar = s;
                    return true;
                }
                else if (OUT_VALUE_TYPE == TYPE_BOOL)
                {
                    s = (String)o;
                    if (s != String.Empty)
                    {
                        outVar = Boolean.Parse(s);
                        return true;
                    }
                    else
                    {
                        outVar = false;
                        return false;
                    }
                }
                else if (OUT_VALUE_TYPE == TYPE_INT)
                {
                    s = (String)o;
                    if (s != String.Empty)
                    {
                        outVar = System.Int32.Parse(s);
                        return true;
                    }
                    else
                    {
                        outVar = 0;
                        return false;
                    }
                }
                else if (OUT_VALUE_TYPE == TYPE_KEYWORD)
                {
                    outVar = (KeyWord)o;
                    return true;
                }
                else
                {
                    outVar = null;
                    return false;
                }
                //}
            }
            catch //(Exception e)
            {
                // _Log(e.ToString());
                return false;
            }
        }