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