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; }
static void Main(string[] args) { unsafe { Location location; location.X = 10; location.Y = 5; Location *lptr = &location; Console.WriteLine(string.Format("location 地址{0},lptr地址{1},lptr值{2}", (int)&location, (int)lptr, *lptr)); Console.WriteLine(string.Format("location.x的地址{0},location.x的值{1}", (int)&(lptr->X), lptr->X)); Console.WriteLine(string.Format("location.y的地址{0},location.y的值{1}", (int)&(lptr->Y), lptr->Y)); } Console.Read(); }
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; } }
public unsafe int getNextObjectOfType(Location* location, int itemId, int lastItemSerial) { return World.getNextObjectOfType(*location, itemId, lastItemSerial); }
public unsafe int createGlobalObjectAt(int ItemID, Location* Location) { ItemAndLocation itemandlocation = new Sharpkick.ItemAndLocation((ushort)ItemID, *Location); return (int)World.CreateItem(itemandlocation); }
public int getNextObjectOfType(Location *location, int itemId, int lastItemSerial) { return(UnsafeNativeMethods.getNextObjectOfType(location, itemId, lastItemSerial)); }
public unsafe int getFirstObjectOfType(Location* location, int itemId) { return World.getFirstObjectOfType(*location, itemId); }
public bool getObjVarLocation(int serial, byte *varName, Location *locationResult) { return(UnsafeNativeMethods.getObjVarLocation(serial, varName, locationResult)); }
public int getFirstObjectOfType(Location *location, int itemId) { return(UnsafeNativeMethods.getFirstObjectOfType(location, itemId)); }
public int createGlobalObjectAt(int ItemID, Location *Location) { return(UnsafeNativeMethods.createGlobalObjectAt(ItemID, Location)); }
public int setObjVarLocation(int serial, byte *name, Location *value) { return(UnsafeNativeMethods.setObjVarLocation(serial, name, value)); }
public static extern int getNextObjectOfType(Location *location, int itemId, int lastItemSerial);
public static extern int getFirstObjectOfType(Location *location, int itemId);
public static extern bool getObjVarLocation(int serial, byte *varName, Location *locationResult);
public static extern int setObjVarLocation(int serial, byte *name, Location *value);
public static extern int createGlobalObjectAt(int ItemID, Location *Location);