/// <summary>
    /// Entry point for populating screen with information from JSON
    /// Based on Current Information Set as dictated by dropdown.
    /// </summary>
    private void PopulateFromJson()
    {
        for (int i = 0; i < InfoContent.childCount; i++)
        {
            Destroy(InfoContent.GetChild(i).gameObject);
        }

        if (_currentInformationSet == InformationSet.WorldInformation)
        {
            _rootObject = WorldDatabase.GetWorldData() ?? Activator.CreateInstance(typeof(WorldData));
        }
        else if (_currentInformationSet == InformationSet.LevelInformation)
        {
            _rootObject = LevelDatabase.GetLevelArrayData() ?? Activator.CreateInstance(typeof(LevelArray));
        }
        else if (_currentInformationSet == InformationSet.RoomInformation)
        {
            _rootObject = RoomDatabase.GetRoomArayData() ?? Activator.CreateInstance(typeof(RoomArray));
        }
        else if (_currentInformationSet == InformationSet.InteractableInformation)
        {
            _rootObject = InteractableDatabase.GetInteractableArray() ?? Activator.CreateInstance(typeof(InteractableArray));
        }
        else if (_currentInformationSet == InformationSet.ObstacleInformation)
        {
            _rootObject = ObstacleDatabase.GetObstacleArray() ?? Activator.CreateInstance(typeof(ObstacleArray));
        }
        else if (_currentInformationSet == InformationSet.ItemInformation)
        {
            _rootObject = ItemDatabase.GetItemArray() ?? Activator.CreateInstance(typeof(ItemArray));
        }
        else if (_currentInformationSet == InformationSet.MessageInformation)
        {
            _rootObject = MessageDatabase.GetMessageData() ?? Activator.CreateInstance(typeof(MessageData));
        }

        PopulateViewGroup(_rootObject, InfoContent);
        MessageUI.text = _currentInformationSet.ToString() + " loaded.";
    }
Exemple #2
0
        private DatabaseFactory()
        {

           connection = new SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), APPDB_PATH);
           

            /*    var sync = new SQLiteConnection(APPDB_PATH);
            connection = new SQLiteConnection(APPDB_PATH);*/

            identityDatabase = new IdentityDatabase(connection);
            threadDatabase = new ThreadDatabase(connection);
            groupDatabase = new GroupDatabase(connection);
            messageDatabase = new MessageDatabase(connection);
            textMessageDatabase = new TextMessageDatabase(connection);

            //contactDatabase = new ContactsDatabase(connection);
            //addressDatabase = new CanonicalAddressDatabase(connection);
            directoryDatabase = new TextSecureDirectory(connection);
            pushDatabase = new PushDatabase(connection);
            recipientDatabase = new RecipientDatabase(connection);
        }