示例#1
0
        public void Load(string filePath)
        {
            LoadMeta(Path.Combine(filePath, "meta.xml"));
            string basedOnFilePath = null;

            if (Meta.BasedOn != null)
            {
                basedOnFilePath = Path.Combine(Path.GetDirectoryName(filePath), Meta.BasedOn);
                if (basedOnFilePath == filePath)
                {
                    throw new ArgumentException("Language cannot be based on itself.");
                }
            }
            if (basedOnFilePath != null)
            {
                Load(basedOnFilePath);
            }
            Messages            = Messages.MergeOrLoad(Messages, Path.Combine(filePath, "messages.xml"), MergeStrategy.Recursive);
            SimpleMessages      = SimpleMessages.MergeOrLoad(SimpleMessages, Path.Combine(filePath, "simpleMessages.xml"), MergeStrategy.Recursive);
            RoleMessages        = RoleMessages.MergeOrLoad(RoleMessages, Path.Combine(filePath, "roles.xml"), MergeStrategy.Recursive);
            ItemMessages        = ItemMessages.MergeOrLoad(ItemMessages, Path.Combine(filePath, "items.xml"), MergeStrategy.Recursive);
            PlaceMessages       = PlaceMessages.MergeOrLoad(PlaceMessages, Path.Combine(filePath, "places.xml"), MergeStrategy.Recursive);
            AchievementMessages = AchievementMessages.MergeOrLoad(AchievementMessages, Path.Combine(filePath, "achievements.xml"), MergeStrategy.Recursive);
            ModuleMessages      = ModuleMessages.MergeOrLoad(ModuleMessages, Path.Combine(filePath, "modules.xml"), MergeStrategy.Recursive);
            PointMessages       = PointMessages.MergeOrLoad(PointMessages, Path.Combine(filePath, "points.xml"), MergeStrategy.Recursive);
        }
示例#2
0
 public void Load(string filePath)
 {
     Messages            = Messages.GetInstance(Path.Combine(filePath, "messages.xml"));
     SimpleMessages      = SimpleMessages.GetInstance(Path.Combine(filePath, "simpleMessages.xml"));
     RoleMessages        = RoleMessages.GetInstance(Path.Combine(filePath, "roles.xml"));
     ItemMessages        = ItemMessages.GetInstance(Path.Combine(filePath, "items.xml"));
     PlaceMessages       = PlaceMessages.GetInstance(Path.Combine(filePath, "places.xml"));
     AchievementMessages = AchievementMessages.GetInstance(Path.Combine(filePath, "achievements.xml"));
     ModuleMessages      = ModuleMessages.GetInstance(Path.Combine(filePath, "modules.xml"));
 }