当前位置: 首页>>代码示例>>C#>>正文


C# GameData.getUser方法代码示例

本文整理汇总了C#中GameData.getUser方法的典型用法代码示例。如果您正苦于以下问题:C# GameData.getUser方法的具体用法?C# GameData.getUser怎么用?C# GameData.getUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameData的用法示例。


在下文中一共展示了GameData.getUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: create

        /// <summary>
        /// Erzeugt einen neuen Trupp
        /// </summary>
        /// <param name="ID">ID</param>
        /// <param name="data">GameData</param>
        /// <returns></returns>
        public static Troop create(int ID, GameData data)
        {
            MySqlDataReader Reader = data.Query("SELECT * FROM `PX_mom-troops` WHERE `ID` = '" + ID + "'");
            Reader.Read();

            int type = (int)Reader["Class"];
            string name = (string)Reader["Name"];
            User UID = data.getUser((int)Reader["UID"]);
            int power = (int)Reader["Power"];
            int health = (int)Reader["health"];
            int team = (int)Reader["team"];
            WorldPoint position = new WorldPoint((string)(Reader["worldpos"]));
            string states = (string)Reader["states"];
            int power2 = (int)Reader["Power2"];
            int power3 = (int)Reader["Power3"];
            int power4 = (int)Reader["Power4"];
            int resistend1 = (int)Reader["Resistend1"];
            int resistend2 = (int)Reader["Resistend2"];
            int resistend3 = (int)Reader["Resistend3"];
            int resistend4 = (int)Reader["Resistend4"];

            int hide = (int)Reader["hide"];
            string verhalten = (string)Reader["verhalten"];

            TroopClass typeClass = data.getTroopType(type);

            Troop troop = new Troop(ID, typeClass, UID, name, team, states);
            troop.position = position;
            troop.health = health;
            troop.power = power;
            troop.power2 = power2;
            troop.power3 = power3;
            troop.power4 = power4;
            troop.resistend1 = resistend1;
            troop.resistend2 = resistend2;
            troop.resistend3 = resistend3;
            troop.resistend4 = resistend4;
            troop.hide = hide;
            troop.verhalten = verhalten;

            troop.fighterTyp = FighterType.TROOP;

            Reader.Close();
            return troop;
        }
开发者ID:MRH4287,项目名称:GameShare,代码行数:51,代码来源:Troop.cs


注:本文中的GameData.getUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。