本文整理汇总了C#中GameData.getShipType方法的典型用法代码示例。如果您正苦于以下问题:C# GameData.getShipType方法的具体用法?C# GameData.getShipType怎么用?C# GameData.getShipType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameData
的用法示例。
在下文中一共展示了GameData.getShipType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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]));
}
}
}
示例2: updateData
/// <summary>
/// Aktualisiert die Objektrefferenzen, die beim erzeugen des Objektes noch nicht vorhanden waren
/// </summary>
public void updateData(GameData data)
{
buildship = new List<ShipClass>();
string[] split = buildship_temp.Split(new String[] { ", " }, StringSplitOptions.None);
foreach (string id in split)
{
if (id != "")
{
int id2 = int.Parse(id);
buildship.Add(data.getShipType(id2));
}
}
/*
buildtroop = new List<TroopClass>();
string[] split2 = buildtroop_temp.Split(new String[] { ", " }, StringSplitOptions.None);
foreach (string id in split2)
{
if (id != "")
{
int id2 = int.Parse(id);
buildtroop.Add(data.getTroopType(id2));
}
}
*/
}