Exemplo n.º 1
0
        /// <summary>
        /// Get full description for Buff
        /// </summary>
        /// <param name="cardID">Buff id to use</param>
        /// <returns>Buff full desscription</returns>
        public static string GetFullDescriptionForBuff(string buffID)
        {
            List <XmlDataNode> foundDataNodes = DM.GameInfos.localizeInfos["EffectTexts"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("effectTextList/BattleEffectText",
                                                                                                                                        attributeToCheck: new Dictionary <string, string>()
            {
                { "ID", buffID }
            });

            if (foundDataNodes.Count <= 0)
            {
                foundDataNodes = DM.EditGameData_Buff.LocalizedBuff.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("effectTextList/BattleEffectText",
                                                                                                                  attributeToCheck: new Dictionary <string, string>()
                {
                    { "ID", buffID }
                });
            }

            if (foundDataNodes.Count > 0)
            {
                XmlDataNode BUFF_NODE     = foundDataNodes[0];
                string      BUFF_NAME_DES = BUFF_NODE.GetInnerTextByPath("Name");
                string      BUFF_DESC     = BUFF_NODE.GetInnerTextByPath("Desc");

                return($"{BUFF_NAME_DES} / {BUFF_DESC}:{buffID}");
            }
            else
            {
                return($"Buff ID :{buffID}");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get full description of stage
        /// </summary>
        /// <param name="stageID">Stage ID to use</param>
        /// <returns>Full description for stage</returns>
        public static string GetFullDescriptionForStage(string stageID)
        {
            List <XmlDataNode> foundDataNodes = DM.GameInfos.staticInfos["StageInfo"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Stage",
                                                                                                                                    attributeToCheck: new Dictionary <string, string>()
            {
                { "id", stageID }
            });

            if (foundDataNodes.Count <= 0)
            {
                foundDataNodes = DM.EditGameData_StageInfo.StaticStageInfo.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Stage",
                                                                                                                         attributeToCheck: new Dictionary <string, string>()
                {
                    { "id", stageID }
                });
            }

            if (foundDataNodes.Count > 0)
            {
                XmlDataNode STAGE_NODE  = foundDataNodes[0];
                string      STAGE_ID    = STAGE_NODE.GetAttributesSafe("id");
                string      CHPATER_NUM = STAGE_NODE.GetInnerTextByPath("Chapter");

                string STAGE_DES   = LocalizedGameDescriptions.GetDescriptionForStage(STAGE_ID);
                string CHAPTER_DES = LocalizedGameDescriptions.GetDescriptionForChapter(CHPATER_NUM);
                return($"{CHAPTER_DES} / {STAGE_DES}:{STAGE_ID}");
            }
            else
            {
                return($"Stage ID :{stageID}");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get full description of Key Book
        /// </summary>
        /// <param name="bookID"></param>
        /// <returns></returns>
        public static string GetFullDescriptionForKeyBook(string bookID)
        {
            List <XmlDataNode> foundDataNodes = DM.GameInfos.staticInfos["EquipPage"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Book",
                                                                                                                                    attributeToCheck: new Dictionary <string, string>()
            {
                { "ID", bookID }
            });

            if (foundDataNodes.Count <= 0)
            {
                foundDataNodes = DM.EditGameData_BookInfos.StaticEquipPage.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Book",
                                                                                                                         attributeToCheck: new Dictionary <string, string>()
                {
                    { "ID", bookID }
                });
            }

            if (foundDataNodes.Count > 0)
            {
                XmlDataNode STAGE_NODE  = foundDataNodes[0];
                string      TEXT_ID     = STAGE_NODE.GetInnerTextByPath("TextId");
                string      CHPATER_NUM = STAGE_NODE.GetInnerTextByPath("Chapter");

                string BOOK_DES = "";

                int KEY_PAGE_ID = Convert.ToInt32(bookID);
                if (KEY_PAGE_ID > 9000000 && KEY_PAGE_ID < 9999999)
                {
                    BOOK_DES = LocalizedGameDescriptions.GetDescriptionForBooks(bookID);
                }
                else
                {
                    BOOK_DES = LocalizedGameDescriptions.GetDescriptionForBooks(TEXT_ID);
                }

                string CHAPTER_DES  = LocalizedGameDescriptions.GetDescriptionForChapter(CHPATER_NUM);
                string DIV_INFO_DES = GetDivideInfo.GetDividedKeyPageInfo(bookID);

                return($"{DIV_INFO_DES} {CHAPTER_DES} / {BOOK_DES}:{bookID}");
            }
            else
            {
                return($"Book ID :{bookID}");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Get inner text by searched name node if not null or empty
        /// </summary>
        /// <param name="path">XmlData path</param>
        /// <param name="defaultText">Default text if given node is null or empty</param>
        /// <returns>Searched text</returns>
        public string GetInnerTextByPath(string path, string defaultText = "")
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }

            List <string> NAME_LIST = path.Split('/').ToList();

            if (NAME_LIST.Count > 1)
            {
                XmlDataNode foundXmlDataNode = subNodes.Find((XmlDataNode xmlDataNode) =>
                {
                    return(xmlDataNode.name == NAME_LIST[0]);
                });
                if (foundXmlDataNode != null)
                {
                    return(foundXmlDataNode.GetInnerTextByPath(String.Join("/", NAME_LIST.Skip(1)), defaultText));
                }
                else
                {
                    return(defaultText);
                }
            }
            else
            {
                XmlDataNode foundXmlDataNode = subNodes.Find((XmlDataNode xmlDataNode) =>
                {
                    return(xmlDataNode.name == NAME_LIST[0]);
                });
                if (foundXmlDataNode != null)
                {
                    return(foundXmlDataNode.innerText);
                }
                else
                {
                    return(defaultText);
                }
            }
        }
Exemplo n.º 5
0
        public static void CheckDatasBySyntaxCheckStrings(string menunName, string referencePath, XmlDataNode rootDataNode, List <string> checkSyntaxStrings, bool isCritical = true)
        {
            string REFERENCE_TEXT = "NO ID";

            if (referencePath.Contains('$'))
            {
                rootDataNode.ActionXmlDataNodesByPath(referencePath.Split('$')[0], (XmlDataNode checkNode) =>
                {
                    REFERENCE_TEXT = checkNode.GetAttributesSafe(referencePath.Split('$').Last());
                });
            }
            else
            {
                REFERENCE_TEXT = rootDataNode.GetInnerTextByPath(referencePath);
            }

            checkSyntaxStrings.ForEach((string checkSyntaxString) =>
            {
                if (checkSyntaxString.Split('#').Count() == 2)
                {
                    string CHECK_PATH = checkSyntaxString.Split('#')[0];
                    string CHECK_FUNC = checkSyntaxString.Split('#')[1];

                    List <string> DUPLICATE_CHECK = new List <string>();
                    rootDataNode.ActionXmlDataNodesByPath(CHECK_PATH.Split('$')[0], (XmlDataNode checkNode) =>
                    {
                        string CHECK_TEXT = "";
                        if (CHECK_PATH.Contains('$'))
                        {
                            CHECK_TEXT = checkNode.GetAttributesSafe(CHECK_PATH.Split('$').Last());
                        }
                        else
                        {
                            CHECK_TEXT = checkNode.innerText;
                        }

                        if (string.IsNullOrEmpty(CHECK_TEXT) && CHECK_FUNC.Contains("B"))
                        {
                            if (isCritical)
                            {
                                CheckDatas.MakeCriticalMessage("ERROR_MESSAGE_01", REFERENCE_TEXT, menunName, CHECK_PATH);
                            }
                            else
                            {
                                CheckDatas.MakeCautionMessage("ERROR_MESSAGE_01", REFERENCE_TEXT, menunName, CHECK_PATH);
                            }
                        }

                        if (!string.IsNullOrEmpty(CHECK_TEXT) && CHECK_FUNC.Contains("D"))
                        {
                            if (DUPLICATE_CHECK.Contains(CHECK_TEXT))
                            {
                                if (isCritical)
                                {
                                    CheckDatas.MakeCriticalMessage("ERROR_MESSAGE_02", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                                else
                                {
                                    CheckDatas.MakeCautionMessage("ERROR_MESSAGE_02", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                            }
                            DUPLICATE_CHECK.Add(CHECK_TEXT);
                        }

                        if (!string.IsNullOrEmpty(CHECK_TEXT) && CHECK_FUNC.Contains("I"))
                        {
                            if (!Tools.CheckInput.IsIntegerInputed(CHECK_TEXT))
                            {
                                if (isCritical)
                                {
                                    CheckDatas.MakeCriticalMessage("ERROR_MESSAGE_03", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                                else
                                {
                                    CheckDatas.MakeCautionMessage("ERROR_MESSAGE_03", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                            }
                        }

                        if (!string.IsNullOrEmpty(CHECK_TEXT) && CHECK_FUNC.Contains("D"))
                        {
                            if (!Tools.CheckInput.IsDoubleInputed(CHECK_TEXT))
                            {
                                if (isCritical)
                                {
                                    CheckDatas.MakeCriticalMessage("ERROR_MESSAGE_04", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                                else
                                {
                                    CheckDatas.MakeCautionMessage("ERROR_MESSAGE_04", REFERENCE_TEXT, menunName, CHECK_PATH);
                                }
                            }
                        }
                    });
                }
            });
        }
Exemplo n.º 6
0
        /// <summary>
        /// Get full description for DropTable
        /// </summary>
        /// <param name="dropTableID">Drop table ID to use</param>
        /// <returns>DropTable full description</returns>
        public static string GetFullDescriptionForDropTable(string dropTableID)
        {
            List <XmlDataNode> foundDataNodes = DM.GameInfos.staticInfos["DropBook"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("BookUse",
                                                                                                                                   attributeToCheck: new Dictionary <string, string>()
            {
                { "ID", dropTableID }
            });

            if (foundDataNodes.Count > 0)
            {
                XmlDataNode CARD_NODE     = foundDataNodes[0];
                string      DROP_BOOK_DES = LocalizedGameDescriptions.GetDescriptionForETC(CARD_NODE.GetInnerTextByPath("TextId"));
                string      CHAPTER_DES   = LocalizedGameDescriptions.GetDescriptionForChapter(CARD_NODE.GetInnerTextByPath("Chapter"));

                return($"{CHAPTER_DES} / {DROP_BOOK_DES}:{dropTableID}");
            }
            else
            {
                return($"Drop Table ID :{dropTableID}");
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Get full description for Card
        /// </summary>
        /// <param name="cardID">Card id to use</param>
        /// <returns>Card full desscription</returns>
        public static string GetFullDescriptionForCard(string cardID)
        {
            List <XmlDataNode> foundDataNodes = DM.GameInfos.staticInfos["Card"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card",
                                                                                                                               attributeToCheck: new Dictionary <string, string>()
            {
                { "ID", cardID }
            });

            if (foundDataNodes.Count <= 0)
            {
                foundDataNodes = DM.EditGameData_CardInfos.StaticCard.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card",
                                                                                                                    attributeToCheck: new Dictionary <string, string>()
                {
                    { "ID", cardID }
                });
            }

            if (foundDataNodes.Count > 0)
            {
                XmlDataNode CARD_NODE     = foundDataNodes[0];
                string      CARD_NAME_DES = LocalizedGameDescriptions.GetDecriptionForCard(CARD_NODE.GetAttributesSafe("ID"));
                string      CHAPTER_DES   = LocalizedGameDescriptions.GetDescriptionForChapter(CARD_NODE.GetInnerTextByPath("Chapter"));
                string      DIV_INFO_DES  = GetDivideInfo.GetDividedCardInfo(cardID);

                return($"{DIV_INFO_DES} {CHAPTER_DES} / {CARD_NAME_DES}:{cardID}");
            }
            else
            {
                return($"Card ID :{cardID}");
            }
        }