示例#1
0
        public void Save(string path, BDatabaseBase db)
        {
            using (var s = KSoft.IO.XmlElementStream.CreateForWrite(kXmlRootName))
            {
                s.InitializeAtRootElement();
                StreamXml(s, FA.Write, XML.BXmlSerializerInterface.GetNullInterface(db));

                s.Document.Save(path);
            }
        }
示例#2
0
        public string GetName(ObjectKind kind, int id)
        {
            switch (kind)
            {
            case ObjectKind.Weapon:         return(BDatabaseBase.TryGetNameWithUndefined(Weapons, id));

            //case ObjectKind.TacticState:return BDatabaseBase.TryGetNameWithUndefined(TacticStates, id);
            case ObjectKind.Action:         return(BDatabaseBase.TryGetNameWithUndefined(Actions, id));

            default: throw new Debug.UnreachableException(kind.ToString());
            }
        }
示例#3
0
        public int GetId(ObjectKind kind, string name)
        {
            switch (kind)
            {
            case ObjectKind.Weapon:                 return(BDatabaseBase.TryGetIdWithUndefined(m_dbiWeapons, name, Weapons));

            //case ObjectKind.TacticState:	return BDatabaseBase.TryGetIdWithUndefined(m_dbiTacticStates, name, TacticStates);
            case ObjectKind.Action:                 return(BDatabaseBase.TryGetIdWithUndefined(m_dbiActions, name, Actions));

            default: throw new Debug.UnreachableException(kind.ToString());
            }
        }