public static FitwGameState MakeDefault() { var lm = new LittleMermaid { sorrow = { Value = new CharacterProperty(3) }, intelligence = { Value = new CharacterProperty(4) }, money = { Value = new ResourceHolder(UnityEngine.Random.Range(0, 1000), 10000) } }; var mainStory = new EndlessSorrowStory() { RandomInt = UnityEngine.Random.Range(0, 10000), DisplayName = "Endless Sorrow", Name = "Endless Sorrow", }; var ch1 = new DummyChapter() { ContainsSceneDirectly = true, DisplayName = "Childhood", Parent = mainStory }; mainStory.Chapters = new Chapter[] { ch1 }; var ch1sc1 = new DummyScene { DisplayName = "First sight about the surface", Parent = ch1 }; var ch1sc2 = new DummyScene { DisplayName = "Second sight about the surface", Parent = ch1 }; var ch1sc3 = new DummyScene { DisplayName = "Third sight about the surface", Parent = ch1 }; ch1.SceneStories = new StoryScene[] { ch1sc1, ch1sc2, ch1sc3 }; mainStory.Chapters = new Chapter[] { ch1 }; var gs = new FitwGameState { characterList = new Character[] { lm }, mainStory = mainStory }; return(gs); }
protected override void Initialize() { base.Initialize(); _nextScene = new DummyScene("Dummy"); }
protected override IEnumerator UnloadScene(DummyScene scene, Action<float, string> progressDelegate) { yield break; }
public override bool Run() { var owner = new UGUI("11223344-1122-1122-1122-123456789012"); var regionID = new UUID("12345678-1234-1234-1234-123456789012"); var scene = new DummyScene(256, 256, regionID); var objgrp = new ObjectGroup(); var part = new ObjectPart { Name = "Test Object" }; var item = new ObjectPartInventoryItem { Name = "Test Item", AssetType = AssetType.CallingCard, InventoryType = InventoryType.CallingCard, Owner = owner }; part.Inventory.Add(item); objgrp.Add(1, part); objgrp.Owner = owner; part.ObjectGroup = objgrp; objgrp.Scene = scene; SceneListener listener = SimulationData.GetSceneListener(regionID); listener.StartStorageThread(); try { m_Log.Info("Checking that region object data is empty"); if (SimulationData.Objects.ObjectsInRegion(regionID).Count != 0) { return(false); } m_Log.Info("Checking that region prim data is empty"); if (SimulationData.Objects.PrimitivesInRegion(regionID).Count != 0) { return(false); } m_Log.Info("Checking that actual object does not exist"); if (SimulationData.Objects.LoadObjects(regionID).Count != 0) { return(false); } m_Log.Info("Store object"); listener.ScheduleUpdate(part.UpdateInfo, regionID); /* ensure working time for listener */ m_Log.Info("Wait 2s for processing"); Thread.Sleep(2000); List <UUID> resultList; m_Log.Info("Checking that region contains one object"); resultList = SimulationData.Objects.ObjectsInRegion(regionID); if (resultList.Count != 1) { return(false); } if (resultList[0] != objgrp.ID) { return(false); } m_Log.Info("Checking that region contains one prim"); resultList = SimulationData.Objects.PrimitivesInRegion(regionID); if (resultList.Count != 1) { return(false); } m_Log.Info("Checking that actual object exists"); List <ObjectGroup> objectList = SimulationData.Objects.LoadObjects(regionID); if (objectList.Count != 1) { return(false); } m_Log.Info("Check that actual object contains one prim"); if (objectList[0].Count != 1) { return(false); } ObjectPart resPart; m_Log.Info("Try retrieving known prim"); if (!objectList[0].TryGetValue(part.ID, out resPart)) { return(false); } m_Log.Info("Check that actual prim contains one item"); if (resPart.Inventory.Count != 1) { return(false); } m_Log.Info("Check that actual item has known ID"); if (!resPart.Inventory.ContainsKey(item.ID)) { return(false); } m_Log.Info("Remove inventory item"); resPart.Inventory.Remove(item.ID); item.UpdateInfo.SetRemovedItem(); listener.ScheduleUpdate(item.UpdateInfo, regionID); /* ensure working time for listener */ m_Log.Info("Wait 2s for processing"); Thread.Sleep(2000); m_Log.Info("check that inventory item got deleted"); objectList = SimulationData.Objects.LoadObjects(regionID); if (objectList.Count != 1 || !objectList[0].TryGetValue(part.ID, out resPart) || resPart.Inventory.Count != 0) { return(false); } m_Log.Info("Remove prim"); part.UpdateInfo.KillObject(); listener.ScheduleUpdate(part.UpdateInfo, regionID); /* ensure working time for listener */ m_Log.Info("Wait 2s for processing"); Thread.Sleep(2000); m_Log.Info("Checking that region object data is empty"); if (SimulationData.Objects.ObjectsInRegion(regionID).Count != 0) { return(false); } m_Log.Info("Checking that region prim data is empty"); if (SimulationData.Objects.PrimitivesInRegion(regionID).Count != 0) { return(false); } m_Log.Info("Checking that actual object does not exist"); if (SimulationData.Objects.LoadObjects(regionID).Count != 0) { return(false); } } finally { listener.StopStorageThread(); } return(true); }
protected override IEnumerator UnloadScene(DummyScene scene, Action <float, string> progressDelegate) { yield break; }