Beispiel #1
0
 public void CreateFurniture(string type)
 {
     Furniture newFurniture = new Furniture(type);
     Furniture.Add(newFurniture);
     OnFurnitureAdded(newFurniture);
 }
Beispiel #2
0
 private void OnFurnitureAdded(Furniture furnitureAdded)
 {
     FurnitureAddedEventHandler handler = FurnitureAdded;
     if (handler != null) handler(this, furnitureAdded);
 }
Beispiel #3
0
 private void OnFurnitureRemoved(Furniture furnitureRemoved, Room newRoom)
 {
     FurnitureRemovedEventHandler handler = FurnitureRemoved;
     if (handler != null) handler(this, furnitureRemoved, newRoom);
 }
Beispiel #4
0
 private void Move(Furniture furniture, Room anotherRoom)
 {
     //TODO: add transaction
     Furniture.Remove(furniture);
     anotherRoom.Furniture.Add(furniture);
     OnFurnitureRemoved(furniture, anotherRoom);
 }