Ejemplo n.º 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);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 7
0
 public int getObjVarInt(int serial, byte* varName)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     return MockObjVarAttachments.GetInt(serial, varname);
 }
Ejemplo n.º 8
0
 public bool hasObjVarOfType(int serial, byte* varName, VariableType varType)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     return MockObjVarAttachments.Has(serial, varType, varname);
 }
Ejemplo n.º 9
0
 public void removeObjVar(int serial, byte* varName)
 {
     string varname = StringPointerUtils.GetAsciiString(varName);
     MockObjVarAttachments.Remove(serial, varname);
 }