public void Load() { IEnumerator enumerator = null; IEnumerator enumerator1 = null; #region Data Directory Modification string str = string.Format("{0}\\Data\\Engine\\Terrain.xml", AppDomain.CurrentDomain.BaseDirectory); #endregion XmlDocument xmlDocument = new XmlDocument(); try { xmlDocument.Load(str); this.i_TerrainTable.Clear(); try { enumerator1 = xmlDocument.SelectNodes("Terrains").GetEnumerator(); while (enumerator1.MoveNext()) { XmlElement current = (XmlElement)enumerator1.Current; try { enumerator = current.SelectNodes("Terrain").GetEnumerator(); while (enumerator.MoveNext()) { ClsTerrain clsTerrain = new ClsTerrain((XmlElement)enumerator.Current); this.i_TerrainTable.Add(clsTerrain.GroupID, clsTerrain); } } finally { if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } } } finally { if (enumerator1 is IDisposable) { ((IDisposable)enumerator1).Dispose(); } } } catch (Exception exception) { ProjectData.SetProjectError(exception); Interaction.MsgBox(exception.Message, MsgBoxStyle.OkOnly, null); Interaction.MsgBox(string.Format("XMLFile:{0}", str), MsgBoxStyle.OkOnly, null); ProjectData.ClearProjectError(); } }
public void Load() { string filename = string.Format("{0}\\Data\\System\\Terrain.xml", (object)AppDomain.CurrentDomain.BaseDirectory); XmlDocument xmlDocument = new XmlDocument(); try { xmlDocument.Load(filename); this.i_TerrainTable.Clear(); try { foreach (XmlElement xmlElement in xmlDocument.SelectNodes("Terrains")) { try { foreach (XmlElement xmlInfo in xmlElement.SelectNodes("Terrain")) { ClsTerrain clsTerrain = new ClsTerrain(xmlInfo); this.i_TerrainTable.Add((object)clsTerrain.GroupID, (object)clsTerrain); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } } catch (Exception ex) { ProjectData.SetProjectError(ex); int num1 = (int)Interaction.MsgBox((object)ex.Message, MsgBoxStyle.OKOnly, (object)null); int num2 = (int)Interaction.MsgBox((object)string.Format("XMLFile:{0}", (object)filename), MsgBoxStyle.OKOnly, (object)null); ProjectData.ClearProjectError(); } }
public void Display(ComboBox iCombo) { IEnumerator enumerator = null; iCombo.Items.Clear(); try { enumerator = this.i_TerrainTable.Values.GetEnumerator(); while (enumerator.MoveNext()) { ClsTerrain current = (ClsTerrain)enumerator.Current; iCombo.Items.Add(current); } } finally { if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } }
public void Load() { IEnumerator enumerator = null; IEnumerator enumerator1 = null; string str = string.Format("{0}\\Data\\System\\Terrain.xml", AppDomain.CurrentDomain.BaseDirectory); XmlDocument xmlDocument = new XmlDocument(); try { xmlDocument.Load(str); this.i_TerrainTable.Clear(); try { enumerator1 = xmlDocument.SelectNodes("Terrains").GetEnumerator(); while (enumerator1.MoveNext()) { XmlElement current = (XmlElement)enumerator1.Current; try { enumerator = current.SelectNodes("Terrain").GetEnumerator(); while (enumerator.MoveNext()) { ClsTerrain clsTerrain = new ClsTerrain((XmlElement)enumerator.Current); this.i_TerrainTable.Add(clsTerrain.GroupID, clsTerrain); } } finally { if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } } } finally { if (enumerator1 is IDisposable) { ((IDisposable)enumerator1).Dispose(); } } } catch (Exception exception) { ProjectData.SetProjectError(exception); Interaction.MsgBox(exception.Message, MsgBoxStyle.OKOnly, null); Interaction.MsgBox(string.Format("XMLFile:{0}", str), MsgBoxStyle.OKOnly, null); ProjectData.ClearProjectError(); } }
private void GroupSelect_SelectedIndexChanged(object sender, EventArgs e) { this.iSelectedGroup = (ClsTerrain)this.GroupSelect.SelectedItem; this.PictureBox3.Image = (Image)Art.GetLand((int)this.iSelectedGroup.TileID); this.Box_TileID.Text = StringType.FromInteger((int)this.iSelectedGroup.TileID); this.Box_TileID_Hex.Text = string.Format("{0:X4}", (object)this.iSelectedGroup.TileID); }
public void Load() { string filename = string.Format("{0}\\Data\\System\\Terrain.xml", (object) AppDomain.CurrentDomain.BaseDirectory); XmlDocument xmlDocument = new XmlDocument(); try { xmlDocument.Load(filename); this.i_TerrainTable.Clear(); try { foreach (XmlElement xmlElement in xmlDocument.SelectNodes("Terrains")) { try { foreach (XmlElement xmlInfo in xmlElement.SelectNodes("Terrain")) { ClsTerrain clsTerrain = new ClsTerrain(xmlInfo); this.i_TerrainTable.Add((object) clsTerrain.GroupID, (object) clsTerrain); } } finally { IEnumerator enumerator; if (enumerator is IDisposable) ((IDisposable) enumerator).Dispose(); } } } finally { IEnumerator enumerator; if (enumerator is IDisposable) ((IDisposable) enumerator).Dispose(); } } catch (Exception ex) { ProjectData.SetProjectError(ex); int num1 = (int) Interaction.MsgBox((object) ex.Message, MsgBoxStyle.OKOnly, (object) null); int num2 = (int) Interaction.MsgBox((object) string.Format("XMLFile:{0}", (object) filename), MsgBoxStyle.OKOnly, (object) null); ProjectData.ClearProjectError(); } }
public void Clone(ClsTerrain iGroupA, ClsTerrain iGroupB) { this.m_Description = this.m_Description.Replace(iGroupA.Name, iGroupB.Name); int num = 0; checked { do { if ((int)this.m_HashKey[num].Key == iGroupA.GroupID) { this.m_HashKey[num].Key = (byte)iGroupB.GroupID; } num++; } while (num <= 8); } }
public Transition(string iDescription, ClsTerrain iGroupA, ClsTerrain iGroupB, string iHashKey, MapTile iMapTile) { this.m_HashKey = new HashKeyCollection(); this.m_StaticTiles = new StaticTileCollection(); this.m_MapTiles = new MapTileCollection(); this.m_RandomTiles = null; this.m_File = null; this.m_Description = iDescription; byte b = 0; do { string sLeft = Strings.Mid(iHashKey, (int)checked(b + 1), 1); if (StringType.StrCmp(sLeft, "A", false) == 0) { this.m_HashKey.Add(new HashKey(iGroupA.GroupID)); } else { if (StringType.StrCmp(sLeft, "B", false) == 0) { this.m_HashKey.Add(new HashKey(iGroupB.GroupID)); } } b += 1; } while (b <= 8); this.m_MapTiles.Add(iMapTile); }
public Transition(string iDescription, string iHashKey, ClsTerrain iGroupA, ClsTerrain iGroupB, MapTileCollection iMapTiles, StaticTileCollection iStaticTiles) { this.m_HashKey = new HashKeyCollection(); this.m_StaticTiles = new StaticTileCollection(); this.m_MapTiles = new MapTileCollection(); this.m_RandomTiles = null; this.m_File = null; this.m_Description = iDescription; byte b = 0; do { string sLeft = Strings.Mid(iHashKey, (int)checked(b + 1), 1); if (StringType.StrCmp(sLeft, "A", false) == 0) { this.m_HashKey.Add(new HashKey(iGroupA.GroupID)); } else { if (StringType.StrCmp(sLeft, "B", false) == 0) { this.m_HashKey.Add(new HashKey(iGroupB.GroupID)); } } b += 1; } while (b <= 8); if (iMapTiles != null) { IEnumerator enumerator = iMapTiles.GetEnumerator(); try { while (enumerator.MoveNext()) { MapTile value = (MapTile)enumerator.Current; this.m_MapTiles.Add(value); } } finally { if (enumerator is IDisposable) { ((IDisposable)enumerator).Dispose(); } } } if (iStaticTiles != null) { IEnumerator enumerator2 = iStaticTiles.GetEnumerator(); try { while (enumerator2.MoveNext()) { StaticTile value2 = (StaticTile)enumerator2.Current; this.m_StaticTiles.Add(value2); } } finally { if (enumerator2 is IDisposable) { ((IDisposable)enumerator2).Dispose(); } } } }