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