public virtual System.Object Clone()
{
ModuleSpec ms;
try
{
ms = (ModuleSpec) base.MemberwiseClone();
}
//UPGRADE_NOTE: Exception 'java.lang.CloneNotSupportedException' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
catch (System.Exception e)
{
throw new System.InvalidOperationException("Error when cloning ModuleSpec instance");
}
// Create a copy of the specValType array
ms.specValType = new byte[nTiles][];
for (int i = 0; i < nTiles; i++)
{
ms.specValType[i] = new byte[nComp];
}
for (int t = 0; t < nTiles; t++)
{
for (int c = 0; c < nComp; c++)
{
ms.specValType[t][c] = specValType[t][c];
}
}
// Create a copy of tileDef
if (tileDef != null)
{
ms.tileDef = new System.Object[nTiles];
for (int t = 0; t < nTiles; t++)
{
ms.tileDef[t] = tileDef[t];
}
}
// Create a copy of tileCompVal
if (tileCompVal != null)
{
ms.tileCompVal = new Dictionary<string, object>();
//UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
for (System.Collections.Generic.IEnumerator<System.String> e = tileCompVal.Keys.GetEnumerator(); e.MoveNext(); )
{
//UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
ms.tileCompVal[e.Current] = tileCompVal[e.Current];
}
}
return ms;
}