コード例 #1
0
ファイル: Room.cs プロジェクト: drypa/FurnitureInRoom
 public void CreateFurniture(string type)
 {
     Furniture newFurniture = new Furniture(type);
     Furniture.Add(newFurniture);
     OnFurnitureAdded(newFurniture);
 }
コード例 #2
0
ファイル: Room.cs プロジェクト: drypa/FurnitureInRoom
 private void OnFurnitureAdded(Furniture furnitureAdded)
 {
     FurnitureAddedEventHandler handler = FurnitureAdded;
     if (handler != null) handler(this, furnitureAdded);
 }
コード例 #3
0
ファイル: Room.cs プロジェクト: drypa/FurnitureInRoom
 private void OnFurnitureRemoved(Furniture furnitureRemoved, Room newRoom)
 {
     FurnitureRemovedEventHandler handler = FurnitureRemoved;
     if (handler != null) handler(this, furnitureRemoved, newRoom);
 }
コード例 #4
0
ファイル: Room.cs プロジェクト: drypa/FurnitureInRoom
 private void Move(Furniture furniture, Room anotherRoom)
 {
     //TODO: add transaction
     Furniture.Remove(furniture);
     anotherRoom.Furniture.Add(furniture);
     OnFurnitureRemoved(furniture, anotherRoom);
 }