public roomInfo BuildingIntoRoom(Building thisBuilding) { roomInfo ThisRoom = new roomInfo(); ThisRoom.RoomName = thisBuilding.BuildingName; ThisRoom.Description = thisBuilding.Description; ThisRoom.AltDescription = thisBuilding.AltDescription; ThisRoom.CanMove = thisBuilding.CanMove; ThisRoom.LockedIn = thisBuilding.LockedIn; ThisRoom.SuicideAction = thisBuilding.SuicideAction; //ThisRoom.ImagePath = thisBuilding.ImagePath; ThisRoom.Events = new List<Event>(); ThisRoom.Civilians = new List<CivilianProfile>(); ThisRoom.items = new List<itemInfo>(); ThisRoom.Enemy = new List<EnemyProfile>(); DataTypes dt = new DataTypes(); if (thisBuilding.Events != null) foreach (Event newEvent in thisBuilding.Events) { ThisRoom.Events.Add(dt.CloneEvent(newEvent)); } if (thisBuilding.Civilians != null) foreach (CivilianProfile NPC in thisBuilding.Civilians) { ThisRoom.Civilians.Add(dt.CloneNPC(NPC)); } if (thisBuilding.items != null) foreach (itemInfo NewItem in thisBuilding.items) { ThisRoom.items.Add(dt.CloneItem(NewItem)); } if (thisBuilding.Enemy != null) foreach (EnemyProfile Enemy in thisBuilding.Enemy) { ThisRoom.Enemy.Add(dt.CloneEnemy(Enemy)); } return ThisRoom; }
private void cmdCloneEvent_Click(object sender, EventArgs e) { if (lstEvents.SelectedIndex > -1) { DataTypes dt = new DataTypes(); Room.Events.Add(dt.CloneEvent(Room.Events[lstEvents.SelectedIndex])); GetAllEvents(); } else { MessageBox.Show("Select an Event to Clone"); } }
public Building RoomIntoBuilding(roomInfo thisRoom) { Building thisBuilding = new Building(); thisBuilding.BuildingName = thisRoom.RoomName; thisBuilding.Description = thisRoom.Description; thisBuilding.AltDescription = thisRoom.AltDescription; thisBuilding.CanMove = thisRoom.CanMove; thisBuilding.LockedIn = thisRoom.LockedIn; thisBuilding.SuicideAction = thisRoom.SuicideAction; //thisBuilding.ImagePath = thisRoom.ImagePath; thisBuilding.Events = new List <Event>(); thisBuilding.Civilians = new List <CivilianProfile>(); thisBuilding.items = new List <itemInfo>(); thisBuilding.Enemy = new List <EnemyProfile>(); DataTypes dt = new DataTypes(); if (thisRoom.Events != null) { foreach (Event newEvent in thisRoom.Events) { thisBuilding.Events.Add(dt.CloneEvent(newEvent)); } } if (thisRoom.Civilians != null) { foreach (CivilianProfile NPC in thisRoom.Civilians) { thisBuilding.Civilians.Add(dt.CloneNPC(NPC)); } } if (thisRoom.items != null) { foreach (itemInfo NewItem in thisRoom.items) { thisBuilding.items.Add(dt.CloneItem(NewItem)); } } if (thisRoom.Enemy != null) { foreach (EnemyProfile Enemy in thisRoom.Enemy) { thisBuilding.Enemy.Add(dt.CloneEnemy(Enemy)); } } return(thisBuilding); }
private void cmdCloneEvent_Click(object sender, EventArgs e) { if (lstEvents.SelectedIndex > -1) { DataTypes dt = new DataTypes(); Room.Events.Add(dt.CloneEvent(Room.Events[lstEvents.SelectedIndex])); GetAllEvents(); } else MessageBox.Show("Select an Event to Clone"); }