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


C# GameData.getRace方法代码示例

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


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

示例1: updateData

        /// <summary>
        /// Aktualisiert die Objektrefferenzen, die beim erzeugen des Objektes noch nicht vorhanden waren
        /// </summary>
        public void updateData(GameData data)
        {
            need_tech = new List<Tech>();

            string[] split1 = need_tech_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split1)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    need_tech.Add(data.getTech(id2));
                }
            }

            race = new List<Race>();

            string[] split2 = race_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split2)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    race.Add(data.getRace(id2));
                }
            }

            skills = new List<Skill>();

            string[] split3 = skills_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split3)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    skills.Add(data.getSkill(id2));
                }
            }
        }
开发者ID:MRH4287,项目名称:GameShare,代码行数:44,代码来源:ShipClass.cs

示例2: updateData

        /// <summary>
        /// Aktualisiert die Objektrefferenzen, die beim erzeugen des Objektes noch nicht vorhanden waren
        /// </summary>
        public void updateData(GameData data)
        {
            if (updateto_temp != 0)
            {
                updateto = data.getStationType(updateto_temp);
            }

            buildship = new List<ShipClass>();

            string[] split = buildship_temp.Split(new String[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string id in split)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    ShipClass add = data.getShipType(id2);

                    if (add != null)
                        buildship.Add(add);
                }
            }

            /*
            buildtroop = new List<TroopClass>();

            string[] split2 = buildtroop_temp.Split(new String[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string id in split2)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    TroopClass add = data.getTroopType(id2);

                    if (add != null)
                        buildtroop.Add(add);
                }
            }

            */

            need_tech = new List<Tech>();

            string[] split3 = need_tech_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split3)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    need_tech.Add(data.getTech(id2));
                }
            }

            race = new List<Race>();

            string[] split4 = race_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split4)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    race.Add(data.getRace(id2));
                }
            }

            //TODO: Skills, etc.

            skills = new List<Skill>();

            string[] split5 = skills_temp.Split(new String[] { ", " }, StringSplitOptions.None);
            foreach (string id in split5)
            {
                if (id != "")
                {
                    int id2 = int.Parse(id);

                    skills.Add(data.getSkill(id2));
                }
            }

            need = new System.Collections.Hashtable();
            string[] need_split = need_temp.Split(new string[] { ", " }, StringSplitOptions.None);
            string[] need_count = need_count_temp.Split(new String[] { ", " }, StringSplitOptions.None);

            for (int i = 0; i < need_split.Length; i++)
            {
                if ((need_count[i] != "") && (need_split[i] != ""))
                {

                    need.Add(data.getStationType(int.Parse(need_split[i])), int.Parse(need_count[i]));
                }
            }
        }
开发者ID:MRH4287,项目名称:GameShare,代码行数:99,代码来源:StationClass.cs

示例3: main

        public void main()
        {
            try
            {
                int serverPort = int.Parse(config["TCP/port"]);
                network = new TCP(serverPort, "GamePW");
                network.OnTextRecieved += new TCP.TextRecievedEvent(TCP_TextRecieved);
                network.OnClientConnected += new TCP.ClientConnectedEvent(TCP_ClientConnected);
                network.OnError += new TCP.TCPErrorEvent(TCP_Error);
                network.OnClientDisconnected += new TCP.ClientDisconnectedEvent(TCP_ClientDisconnected);

                log("Lade Spiel Daten ... ");

                string filepath = config["Game/GameDataPath"] + "GameData.dat";
                if (!File.Exists(filepath))
                {
                    Console.WriteLine("Game Data Datei nicht gefunden!");
                    close = true;
                    return;
                }

                game = new GameData(filepath);
                log("Spiel Dateien erfolgreich geparsed");

                modulmanager = new ModulManager(this);
                log("Modul Manager erfolgreich gestartet");

                printStatistics();

                //  log("Server bereit für Anfragen ...");

                // TestUser
                User user = new User(1, "test", "4", game.getRace(1));
                user.password = "test";
                user.encryptPassword();

                addUser(user);

                log("Lade Map-Daten bitte warten...");

                modulmanager.map.load(config["Game/Map/File"]);

            }
            catch (Exception ex)
            {
                log("Fehler: " + ex.Message);
                close = true;
            }
        }
开发者ID:MRH4287,项目名称:GameServer,代码行数:49,代码来源:Main.cs


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