Example #1
0
 public byte* getObjVarString(int serial, byte* varName)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     string value = MockObjVarAttachments.GetString(serial, varname);
     if (value == null)
         return null;
     return bytePtrFactory.MakePointerToTempString(value);
 }
Example #2
0
        public unsafe int setObjVarLocation(int serial, byte* name, Location* value)
        {
            if (!Exists(serial)) return 0;

            string varname = StringPointerUtils.GetAsciiString(name);
            Location varvalue = *value;
            MockObjVarAttachments.AddAttachment(serial, VariableType.Location, varname, varvalue);
            return 1;
        }
Example #3
0
        public unsafe int setObjVarInt(int serial, byte* name, int value)
        {
            if (!Exists(serial)) return 0;

            string varname = StringPointerUtils.GetAsciiString(name);

            MockObjVarAttachments.AddAttachment(serial, VariableType.Integer, varname, value);
            return 1;
        }
Example #4
0
        public unsafe int setObjVarString(int serial, byte *name, byte *value)
        {
            if (!Exists(serial))
            {
                return(0);
            }

            string varname  = StringPointerUtils.GetAsciiString(name);
            string varvalue = StringPointerUtils.GetAsciiString(value);

            MockObjVarAttachments.AddAttachment(serial, VariableType.String, varname, varvalue);
            return(1);
        }
Example #5
0
 public bool DeleteItem(Serial serial)
 {
     if (WorldObjects.ContainsKey(serial))
     {
         MockScriptAttachments.DeleteAllFor(serial);
         MockObjVarAttachments.DeleteAllFor(serial);
         ObjectPropertyExtensions.Purge(WorldObjects[serial]);
         WorldObjects.Remove(serial);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #6
0
 public bool getObjVarLocation(int serial, byte* varName, Location* locationResult)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     Location value;
     if (MockObjVarAttachments.GetLocation(serial, varname, out value))
     {
         *locationResult = value;
         return true;
     }
     else
     {
         *locationResult = new Location();
         return false;
     }
 }
Example #7
0
 public int getObjVarInt(int serial, byte* varName)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     return MockObjVarAttachments.GetInt(serial, varname);
 }
Example #8
0
 public bool hasObjVarOfType(int serial, byte* varName, VariableType varType)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     return MockObjVarAttachments.Has(serial, varType, varname);
 }
Example #9
0
 public void removeObjVar(int serial, byte* varName)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     MockObjVarAttachments.Remove(serial, varname);
 }