コード例 #1
0
    public void ProcessMultipleGameDescriptor(List <GameDescriptor> gameDescriptors, Dictionary <string, MemoryStream> images)
    {
        if (gameDescriptors.Count == 0)
        {
            return;
        }

        GameDescriptor root = GetRootDescriptor(gameDescriptors);

        if (root == null)
        {
            root = gameDescriptors[0];
        }
        string gameName        = root.gameName;
        string version         = root.version ?? "";
        string gameStorageName = gameName + "_" + version;

        if (PersistanceHelper.CheckGameDirectory(gameStorageName))
        {
            SetExistingGemAsCurrent(gameStorageName);
            return;
        }

        elementManager         = new GameElementManager(gameStorageName);
        elementManager.DefLang = root.GameProperties.defaultLang;
        PersistanceHelper.CreateStorage(gameStorageName);
        PersistanceHelper.StoreImages(gameStorageName, images);
        foreach (GameDescriptor descripor in gameDescriptors)
        {
            ProcessGameDescriptor(descripor);
        }
        if (OnReferenceProcessing != null)
        {
            OnReferenceProcessing(null, EventArgs.Empty);
        }
        elementManager.SetFirstRoom();
        PersistanceHelper.StoreInitialGEM(gameStorageName, elementManager);
        ObjectManager.CurrentGEM = elementManager;
    }