本文整理汇总了C#中IZone.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# IZone.Clone方法的具体用法?C# IZone.Clone怎么用?C# IZone.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IZone
的用法示例。
在下文中一共展示了IZone.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReplaceSelectedZone
public void ReplaceSelectedZone(IZone zone, ICopy ICopyParams)
{
int x = SelectedZone.X;
int y = SelectedZone.Y;
IZone copyzone = zone.Clone();
if (ICopyParams is Copy)
{
Copy CopyParams = (Copy)ICopyParams;
IExtZone ExtSelectedZone = (IExtZone)SelectedZone;
IExtZone ExtCopyZone = (IExtZone)copyzone;
if (CopyParams.CopyDifficulty)
ExtSelectedZone.Difficulty = ExtCopyZone.Difficulty;
if (CopyParams.CopyGroups)
{
if (CopyParams.Overwrite)
ExtSelectedZone.EncounterGroups = ExtCopyZone.EncounterGroups;
else
{
ExtSelectedZone.EncounterGroups.AddRange(ExtCopyZone.EncounterGroups);
ExtSelectedZone.EncounterGroups = Utils.RemoveDuplicates<EncounterZoneGroup>(ExtSelectedZone.EncounterGroups);
}
}
if (CopyParams.CopyLocations)
{
if (CopyParams.Overwrite)
ExtSelectedZone.EncounterLocations = ExtCopyZone.EncounterLocations;
else
{
ExtSelectedZone.EncounterLocations.AddRange(ExtCopyZone.EncounterLocations);
ExtSelectedZone.EncounterLocations = Utils.RemoveDuplicates<EncounterZoneLocation>(ExtCopyZone.EncounterLocations);
}
}
if (ExtSelectedZone.EncounterGroups == null)
ExtSelectedZone.EncounterGroups = new List<EncounterZoneGroup>();
if (ExtSelectedZone.EncounterLocations == null)
ExtSelectedZone.EncounterLocations = new List<EncounterZoneLocation>();
}
if (ICopyParams.CopyTerrain)
SelectedZone.Terrain = copyzone.Terrain;
if (ICopyParams.CopyChance)
SelectedZone.Chance = copyzone.Chance;
SelectedZone.Brushed = copyzone.Brushed;
SelectedZone.X = x;
SelectedZone.Y = y;
SaveSelected();
}