Beispiel #1
0
        private void processBeatmap(int beatmapId, List <Ruleset> rulesets)
        {
            try
            {
                var localBeatmap = BeatmapLoader.GetBeatmap(beatmapId, Verbose, ForceDownload);
                if (localBeatmap == null)
                {
                    reporter.Warn($"Beatmap {beatmapId} skipped (beatmap file not found).");
                    return;
                }

                using (var conn = MasterDatabase.GetConnection())
                {
                    if (Converts && localBeatmap.BeatmapInfo.RulesetID == 0)
                    {
                        foreach (var ruleset in rulesets)
                        {
                            computeDifficulty(beatmapId, localBeatmap, ruleset, conn);
                        }
                    }
                    else if (rulesets.Any(r => r.RulesetInfo.ID == localBeatmap.BeatmapInfo.RulesetID))
                    {
                        computeDifficulty(beatmapId, localBeatmap, localBeatmap.BeatmapInfo.Ruleset.CreateInstance(), conn);
                    }
                }

                reporter.Verbose($"Difficulty updated for beatmap {beatmapId}.");
            }
            catch (Exception e)
            {
                reporter.Error($"{beatmapId} failed with: {e}");
            }

            Interlocked.Increment(ref processedBeatmaps);
        }
    void OnEnable()
    {
        md = new MasterDatabase();
        md.LoadMasterData();

        LoadDatabases();

        PopulateDatabases();
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     // Make Singleton Data
     if (MasterData == null)
     {
         DontDestroyOnLoad(gameObject);
         MasterData = this;
     }
     else if (MasterData != this)
     {
         Destroy(gameObject);
     }
 }
        public void CreateItem <TEntity>(string itemPath, TEntity entity) where TEntity : ISitecoreDomainEntity
        {
            Map <TEntity> map = MapFinder.FindMap <TEntity>();

            TemplateItem templateItem = GetTemplateItem(map.TemplatePath);

            using (new SecurityDisabler())
            {
                Item newItem = MasterDatabase.CreateItemPath(itemPath, templateItem);

                SaveItem(newItem, map, entity);
            }
        }
 // Use this for initialization
 void Start()
 {
     // Make Singleton Data
     if (MasterData == null)
     {
         DontDestroyOnLoad(gameObject);
         MasterData = this;
     }
     else if (MasterData != this)
     {
         Destroy(gameObject);
     }
 }
    public static GameObject GetVisualsByID(int pieceID, bool team)
    {
        if (instance == null)
        {
            instance = ((GameObject)Resources.Load("Master Database")).GetComponent <MasterDatabase>();
        }

        if (team)
        {
            return(instance.gamePieceVisualsWhite[pieceID]);
        }

        return(instance.gamePieceVisualsBlack[pieceID]);
    }
        protected override void Render(HtmlTextWriter output)
        {
            Item currentItem = MasterDatabase.GetItem(ItemID);

            if (currentItem.IsNull())
            {
                Logger.Error("FieldSuite.ImagesField - Unable to find current item while rendering: " + ItemID);
                return;
            }

            //iterate over images
            string rotatingImageHtml = string.Empty;
            int    i = 0;

            foreach (string itemId in FieldValues)
            {
                if (string.IsNullOrEmpty(itemId))
                {
                    continue;
                }

                //image wrapper
                rotatingImageHtml += RenderItem(itemId);
                i++;
            }

            int wrappingWidth = i * 185;

            //output to user that there are none selected)
            if (string.IsNullOrEmpty(rotatingImageHtml))
            {
                rotatingImageHtml = "<div class=\"velirImagesFieldNoValue\">No Rotating Images have been selected.</div>";
            }

            //write back to output for rendering
            string hiddenField = "<input id=\"" + this.ID + "_Value\" type=\"hidden\" value=\"" + StringUtil.EscapeQuote(this.Value) + "\" />";

            output.Write(string.Format("<div id=\"{2}\" class=\"scContentControlHtml rotatingContentControl\" style=\"\">{3}<div class=\"velirImageItems\" style=\"width:{1}px;\">{0}</div></div>", rotatingImageHtml, wrappingWidth, this.ID, hiddenField));
        }
    public void UpdateBoardVisuals()
    {
        // Clear old visuals
        foreach (GeneralManager.GamePiece piece in GeneralManager.gameBoard.whitePieces)
        {
            if (piece.visual != null)
            {
                Destroy(piece.visual.gameObject);
            }
        }

        foreach (GeneralManager.GamePiece piece in GeneralManager.gameBoard.blackPieces)
        {
            if (piece.visual != null)
            {
                Destroy(piece.visual.gameObject);
            }
        }

        foreach (GeneralManager.GamePiece piece in GeneralManager.gameBoard.whitePieces)
        {
            piece.visual = Instantiate(MasterDatabase.GetVisualsByID((int)piece.piece, true), GeneralManager.GetTileCenterPos(piece.position), Quaternion.identity).GetComponent <GamePieceVisual>();
            piece.visual.UpdateVisual(team, piece.health, piece.attack, piece.frozen);
        }

        foreach (GeneralManager.GamePiece piece in GeneralManager.gameBoard.blackPieces)
        {
            piece.visual = Instantiate(MasterDatabase.GetVisualsByID((int)piece.piece, false), GeneralManager.GetTileCenterPos(piece.position), Quaternion.identity).GetComponent <GamePieceVisual>();
            piece.visual.UpdateVisual(team, piece.health, piece.attack, piece.frozen);
        }

        manaFieldUI.UpdateManaVisuals(currentMana);

        // Unselect
        curSelected            = new Vector2Int(-1, -1);
        selectorPlane.position = new Vector3(0f, -100f, 0f);
        selectionFieldUI.DisableMenu();
    }
 private Item GetMasterItem()
 {
     Assert.IsNotNull(MasterDatabase, "DatabaseOne must be set!");
     return(MasterDatabase.GetItem(ID, LanguageManager.GetLanguage(LanguageDropDown.SelectedItem.Value), Sitecore.Data.Version.Latest));
 }
    void OnEnable()
    {
        md = new MasterDatabase();
        md.LoadMasterData();

        LoadDatabases();

        PopulateDatabases();
    }