/// <summary> /// Creates an instance of this (multitile) object in the target VM, out of world. /// </summary> /// <param name="vm"></param> public VMMultitileGroup CreateInstance(VM vm) { int i = 0; foreach (var ent in Entities) { VMEntity realEnt; var objDefinition = FSO.Content.Content.Get().WorldObjects.Get(ent.GUID); var worldObject = vm.Context.MakeObjectComponent(objDefinition); var obj = new VMGameObject(objDefinition, worldObject); obj.Load((VMGameObjectMarshal)ent); obj.Contained = new VMEntity[ent.Contained.Length]; //we aren't loading slot data, but we need to initialize this. obj.Position = LotTilePos.OUT_OF_WORLD; if (VM.UseWorld) { vm.Context.Blueprint.AddObject((ObjectComponent)obj.WorldUI); vm.Context.Blueprint.ChangeObjectLocation((ObjectComponent)obj.WorldUI, obj.Position); } realEnt = obj; obj.FetchTreeByName(vm.Context); obj.Thread = new VMThread(vm.Context, obj, obj.Object.OBJ.StackSize); vm.AddEntity(obj); MultitileGroup.Objects[i++] = obj.ObjectID; //update saved group, in multitile group order (as saved) if (VM.UseWorld) { obj.WorldUI.ObjectID = obj.ObjectID; } vm.Scheduler.ScheduleTickIn(obj, 1); } return(new VMMultitileGroup(MultitileGroup, vm.Context)); //should self register }
public override bool CanManageAsyncSale(VMAvatar ava, VMGameObject obj) { if (ava == null || obj == null || obj is VMAvatar || obj.PersistID == 0) { return(false); } return(ava.AvatarState.Permissions >= VMTSOAvatarPermissions.Roommate && ava.PersistID == (obj.TSOState as VMTSOObjectState).OwnerID); }
/// <summary> /// Creates an instance of this (multitile) object in the target VM, out of world. /// </summary> /// <param name="vm"></param> public VMMultitileGroup CreateInstance(VM vm, bool ghost) { int i = 0; var objs = new VMEntity[Entities.Length]; foreach (var ent in Entities) { VMEntity realEnt; var objDefinition = FSO.Content.Content.Get().WorldObjects.Get(ent.GUID, false); var worldObject = vm.Context.MakeObjectComponent(objDefinition); var obj = new VMGameObject(objDefinition, worldObject); obj.Load((VMGameObjectMarshal)ent); obj.Contained = new VMEntity[ent.Contained.Length]; //we aren't loading slot data, but we need to initialize this. obj.Position = LotTilePos.OUT_OF_WORLD; if (VM.UseWorld) { vm.Context.Blueprint.AddObject((ObjectComponent)obj.WorldUI); vm.Context.Blueprint.ChangeObjectLocation((ObjectComponent)obj.WorldUI, obj.Position); } realEnt = obj; obj.FetchTreeByName(vm.Context); if (!ghost) { obj.Thread = new VMThread(vm.Context, obj, obj.Object.OBJ.StackSize); vm.AddEntity(obj); } else { objs[i] = obj; } obj.GhostImage = ghost; MultitileGroup.Objects[i++] = obj.ObjectID; //update saved group, in multitile group order (as saved) if (VM.UseWorld) { obj.WorldUI.ObjectID = obj.ObjectID; } //if (!ghost) vm.InternalTick(obj, 1); } VMMultitileGroup multi; if (ghost) { multi = new VMMultitileGroup(); multi.LoadGhost(MultitileGroup, vm.Context, objs); } else { multi = new VMMultitileGroup(MultitileGroup, vm.Context); } return(multi); //should self register }
public VMGameObject CreateObject(XmlHouseDataObject obj) { var objDefinition = Content.Get().WorldObjects.Get(obj.GUIDInt); if (objDefinition == null){ return null; } var worldObject = new ObjectComponent(objDefinition); worldObject.Direction = obj.Direction; var vmObject = new VMGameObject(objDefinition, worldObject); VM.AddEntity(vmObject); Blueprint.ChangeObjectLocation(worldObject, (short)obj.X, (short)obj.Y, (sbyte)obj.Level); return vmObject; }
public VMGameObject CreateObject(XmlHouseDataObject obj) { var objDefinition = Content.Get().WorldObjects.Get(obj.GUIDInt); if (objDefinition == null) { return(null); } var worldObject = new ObjectComponent(objDefinition); worldObject.Direction = obj.Direction; var vmObject = new VMGameObject(objDefinition, worldObject); VM.AddEntity(vmObject); Blueprint.ChangeObjectLocation(worldObject, (short)obj.X, (short)obj.Y, (sbyte)obj.Level); return(vmObject); }
public override bool CanSendbackObject(VMAvatar ava, VMGameObject obj) { return((obj.TSOState as VMTSOObjectState).OwnerID == ava.PersistID && !(obj.TSOState as VMTSOObjectState).ObjectFlags.HasFlag(VMTSOObjectFlags.FSODonated)); }
public override bool CanManageAsyncSale(VMAvatar ava, VMGameObject obj) { //currently cannot sell anything on a community lot. //commented lets people sell non-donated objects return(false); // CanSendbackObject(ava, obj); }
public override bool CanSendbackObject(VMAvatar ava, VMGameObject obj) { return(ava.AvatarState.Permissions >= VMTSOAvatarPermissions.Roommate); }
public abstract bool CanManageAsyncSale(VMAvatar ava, VMGameObject obj);
public abstract bool CanSendbackObject(VMAvatar ava, VMGameObject obj);