/// <summary> /// Constructor /// </summary> /// <param name="ultima5Directory">ultima 5 data and save game directory</param> public World(string ultima5Directory) : base() { _u5Directory = ultima5Directory; DataOvlRef = new DataOvlReference(_u5Directory); SmallMapRef = new SmallMapReferences(DataOvlRef); // build the overworld map OverworldMap = new LargeMap(_u5Directory, LargeMap.Maps.Overworld, _tileOverrides); // build the underworld map UnderworldMap = new LargeMap(_u5Directory, LargeMap.Maps.Underworld, _tileOverrides); SpriteTileReferences = new TileReferences(DataOvlRef.StringReferences); InvRef = new InventoryReferences(); LargeMapRef = new LargeMapLocationReferences(DataOvlRef); AllSmallMaps = new SmallMaps(SmallMapRef, _u5Directory, SpriteTileReferences, _tileOverrides); MoonPhaseRefs = new MoonPhaseReferences(DataOvlRef); State = new GameState(_u5Directory, DataOvlRef); // build all combat maps from the Combat Map References foreach (CombatMapReference.SingleCombatMapReference combatMapRef in _combatMapRef.MapReferenceList) { CombatMap combatMap = new CombatMap(_u5Directory, combatMapRef, _tileOverrides); } // build a "look" table for all tiles LookRef = new Look(_u5Directory); // build the sign tables SignRef = new Signs(_u5Directory); TalkScriptsRef = new TalkScripts(_u5Directory, DataOvlRef); // build the NPC tables NpcRef = new NonPlayerCharacterReferences(_u5Directory, SmallMapRef, TalkScriptsRef, State); ShoppeKeeperDialogueReference = new ShoppeKeeperDialogueReference(_u5Directory, DataOvlRef, NpcRef, State.PlayerInventory); // sadly I have to initialize this after the NPCs are created because there is a circular dependency State.InitializeVirtualMap(SmallMapRef, AllSmallMaps, LargeMapRef, OverworldMap, UnderworldMap, NpcRef, SpriteTileReferences, State, NpcRef, InvRef); if (State.Location != SmallMapReferences.SingleMapReference.Location.Britannia_Underworld) { State.TheVirtualMap.LoadSmallMap(SmallMapRef.GetSingleMapByLocation(State.Location, State.Floor), State.CharacterRecords, true); } else { State.TheVirtualMap.LoadLargeMap(LargeMap.Maps.Overworld); } }
public void Test_InventoryReferences() { InventoryReferences invRefs = new InventoryReferences(); List <InventoryReference> invList = invRefs.GetInventoryReferenceList(InventoryReferences.InventoryReferenceType.Armament); foreach (InventoryReference invRef in invList) { string str = invRef.GetRichTextDescription(); str = invRefs.HighlightKeywords(str); } }
private void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; } foreach (ItemScriptable itemScript in itemList) { itemDictionary.Add(itemScript.name, itemScript); } }