public Doodad(Doodad d) { id = d.id; position = d.position; up = d.up; activationCost = d.activationCost; targetBehavior = d.targetBehavior; targetObject = d.targetObject; expectBehavior = d.expectBehavior; fixedPosition = d.fixedPosition; type = d.type; ability = d.ability; behaviors = new List<Behavior>(); foreach (Behavior b in d.behaviors) { behaviors.Add(new Behavior(b)); } }
void world_copy(object sender, System.EventArgs e) { if (sender == this.elementCopy) { if (editMode == EditMode.Monster) { undoWorld = new World(world); Monster newMonster = new Monster(selectedMonster); newMonster.Init(); selectedFace.monsters.Add(newMonster); } if (editMode == EditMode.Block) { undoWorld = new World(world); Block newBlock = new Block(selectedBlock); newBlock.Init(); selectedFace.blocks.Add(newBlock); } if (editMode == EditMode.Doodad) { undoWorld = new World(world); Doodad newDoodad = new Doodad(selectedDoodad); newDoodad.Init(); selectedFace.doodads.Add(newDoodad); } if (editMode == EditMode.Decoration) { undoWorld = new World(world); Decoration newDecoration = new Decoration(selectedDecoration); newDecoration.Init(); selectedFace.decorations.Add(newDecoration); } } }