Esempio n. 1
0
        public AddRoomPresenter(IAddRoomView view,
                                IRoomFactory roomFactory,
                                IRoomsService roomsService,
                                IImageUploader imageUploader) : base(view)
        {
            if (roomsService == null)
            {
                throw new ArgumentNullException("Rooms service cannot be null.");
            }

            if (roomFactory == null)
            {
                throw new ArgumentNullException("Room factory cannot be null.");
            }

            if (imageUploader == null)
            {
                throw new ArgumentNullException("Image uploader cannot be null.");
            }

            this.roomsService         = roomsService;
            this.roomFactory          = roomFactory;
            this.imageUploader        = imageUploader;
            this.View.AddingRoom     += OnAddingRoom;
            this.View.UploadingImage += OnUploadingImage;
        }
Esempio n. 2
0
        public RoomCollection(IRoomFactory roomFactory, int numberOfRooms, int singleRooms, int doubleRooms, int kingSizeRooms)
        {
            //todo class
            if (singleRooms + doubleRooms + kingSizeRooms > numberOfRooms)
            {
                throw new NotImplementedException();
            }

            this.roomFactory   = roomFactory;
            this.numberOfRooms = numberOfRooms;
            for (int i = 0; i < singleRooms; i++)
            {
                roomCollection.Add(i + 1, roomFactory.GetRoomType("Single"));
            }

            for (int i = singleRooms; i < singleRooms + doubleRooms; i++)
            {
                roomCollection.Add(i + 1, roomFactory.GetRoomType("Double"));
            }

            for (int i = singleRooms + doubleRooms; i < singleRooms + doubleRooms + kingSizeRooms; i++)
            {
                roomCollection.Add(i + 1, roomFactory.GetRoomType("KingSizeRoom"));
            }
        }
Esempio n. 3
0
 public StoryMaker(IRoomFactory roomFactory,
                   IMonsterFactory monsterFactory,
                   ILootFactory lootFactory)
 {
     _roomFactory    = roomFactory;
     _monsterFactory = monsterFactory;
     _lootFactory    = lootFactory;
 }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MudZone"/> class.
        /// </summary>
        public MudZone(IRoomFactory roomFactory, IRealm owner)
        {
            this.WeatherUpdateFrequency = 15;
            this.rooms = new List<IRoom>();
            this.weatherStates = new List<IWeatherState>();

            this.Owner = owner;
            this.roomFactory = roomFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MudZone"/> class.
        /// </summary>
        public MudZone(IRoomFactory roomFactory, IRealm owner)
        {
            this.WeatherUpdateFrequency = 15;
            this.rooms         = new List <IRoom>();
            this.weatherStates = new List <IWeatherState>();

            this.Owner       = owner;
            this.roomFactory = roomFactory;
        }
Esempio n. 6
0
		public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
			IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog, IAudioFactory sound)
		{
			Graphics = graphics;
			Inventory = inventory;
			UI = ui;
			Room = room;
			Outfit = outfit;
			Object = obj;
			Dialog = dialog;
			Sound = sound;
		}
        void ShowRoomProject(IRoomFactory roomFactory)
        {
            Console.WriteLine();
            Console.WriteLine("Budujemy pokoj w stylu " + roomFactory.GetType().Name);
            Console.WriteLine("Pokoj będzię się składał z:");
            IChair chair = roomFactory.CreateChair();

            Console.WriteLine(chair.Show());
            ISofa sofa = roomFactory.CreateSofa();

            Console.WriteLine(sofa.Show());
            Console.WriteLine();
        }
Esempio n. 8
0
 public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                       IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                       IAudioFactory sound, IFontLoader fontFactory)
 {
     Graphics  = graphics;
     Inventory = inventory;
     UI        = ui;
     Room      = room;
     Outfit    = outfit;
     Object    = obj;
     Dialog    = dialog;
     Sound     = sound;
     Fonts     = fontFactory;
 }
Esempio n. 9
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter flat style: (light or dark)");
            string flatStyle = Console.ReadLine();

            Flat flat = new Flat();

            //todo
            IRoomFactory factory = CreateFactory(flatStyle);

            flat.Room1   = factory.CreateRoom();
            flat.Room2   = factory.CreateRoom();
            flat.Balcony = factory.CreateBalcony();
        }
 public NewRoomRequestHandler(
     IDispatchQueue centralDispatchQueue,
     IRoomRepository roomRepository,
     IRoomFactory roomFactory,
     IObserver <TransceiverMetadataUpdatedEvent> transceiverMetadataUpdatedObserver)
 {
     _centralDispatchQueue = centralDispatchQueue
                             ?? throw new ArgumentNullException(nameof(centralDispatchQueue));
     _roomRepository = roomRepository
                       ?? throw new ArgumentNullException(nameof(roomRepository));
     _roomFactory = roomFactory
                    ?? throw new ArgumentNullException(nameof(roomFactory));
     _transceiverMetadataUpdatedObserver = transceiverMetadataUpdatedObserver
                                           ?? throw new ArgumentNullException(nameof(transceiverMetadataUpdatedObserver));
 }
Esempio n. 11
0
 public void Validate(IWorld world, IRoomFactory roomFactory, string title)
 {
     foreach (var blue in roomFactory.Blueprints)
     {
         try
         {
             var room = roomFactory.Create(world, blue);
             world.Map[new Point3(0, 0, 0)] = room;
             world.Player.CurrentLocation   = room;
             ValidateRoom(world, room);
         }
         catch (Exception e)
         {
             AddError($"Error creating RoomBlueprint for RoomFactory '{title}'.  Error was in {blue.Identifier?.ToString() ?? "Unamed Blueprint"}", e);
         }
     }
 }
Esempio n. 12
0
        public AGSGameFactory(IGraphicsFactory graphics, IInventoryFactory inventory, IUIFactory ui,
                              IRoomFactory room, IOutfitFactory outfit, IObjectFactory obj, IDialogFactory dialog,
                              IAudioFactory sound, IFontLoader fontFactory, IResourceLoader resources, IShaderFactory shaders,
                              Resolver resolver)
        {
            Graphics  = graphics;
            Inventory = inventory;
            UI        = ui;
            Room      = room;
            Outfit    = outfit;
            Object    = obj;
            Dialog    = dialog;
            Sound     = sound;
            Fonts     = fontFactory;
            Resources = resources;
            TypedParameter gameFactoryParam = new TypedParameter(typeof(IGameFactory), this);

            Masks   = resolver.Container.Resolve <IMaskLoader>(gameFactoryParam);
            Shaders = shaders;
        }
Esempio n. 13
0
        public StoryElements(IMonsterFactory monsterFactory, ILootFactory lootFactory, IRoomFactory roomFactory)
        {
            if (monsterFactory == null)
            {
                throw new ArgumentNullException("A monsterFactory must be supplied");
            }

            if (lootFactory == null)
            {
                throw new ArgumentNullException("A lootFactory must be supplied");
            }

            if (roomFactory == null)
            {
                throw new ArgumentNullException("A roomFactory must be supplied");
            }

            this.monsterFactory = monsterFactory;
            this.lootFactory    = lootFactory;
            this.roomFactory    = roomFactory;
        }
Esempio n. 14
0
        static void Main()
        {
            Console.WriteLine("You are about to make home improvements.");
            Console.WriteLine("Now you have to choose a color scheme.");
            Console.WriteLine("Please, type 1 for light style or 2 for dark style.");
            Console.Write("Enter your choice: ");

            string choice = Console.ReadLine();

            IRoomFactory factory = CreateFactory(choice);

            var flat = new Flat {
                Room1 = factory.CreateRoom(), Room2 = factory.CreateRoom()
            };

            Console.WriteLine("Your Room1 wallpaper is {0}.", flat.Room1.Wallpaper.Color);
            Console.WriteLine("Your Room1 chandelier is {0}.", flat.Room1.Chandelier.Color);

            Console.WriteLine("Your Room2 wallpaper is {0}.", flat.Room2.Wallpaper.Color);
            Console.WriteLine("Your Room2 chandelier is {0}.", flat.Room2.Chandelier.Color);

            Console.Write("Press any key to close the application: ");
            Console.ReadLine();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MudZone"/> class.
 /// </summary>
 /// <param name="weatherStates">The weather states that can be applied to this zone.</param>
 public MudZone(IRoomFactory roomFactory, IRealm owner, IEnumerable <IWeatherState> weatherStates) : this(roomFactory, owner)
 {
     this.weatherStates = new List <IWeatherState>(weatherStates);
 }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MudZoneFactory"/> class.
 /// </summary>
 /// <param name="roomFactory">The room factory.</param>
 public MudZoneFactory(IRoomFactory roomFactory)
 {
     this.roomFactory = roomFactory;
 }
Esempio n. 17
0
 public RoomAreaService(IUnitOfWork unitOfWork, IRoomFactory roomFactory)
 {
     _unitOfWork  = unitOfWork;
     _roomFactory = roomFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MudZoneFactory"/> class.
 /// </summary>
 /// <param name="roomFactory">The room factory.</param>
 public MudZoneFactory(IRoomFactory roomFactory)
 {
     this.roomFactory = roomFactory;
 }
Esempio n. 19
0
 public RoomFactoryTests()
 {
     rf = new RoomFactory();
 }
Esempio n. 20
0
 public RoomViewModel(IRoomFactory roomFactory)
 {
     _roomFactory = roomFactory;
     _charles = new Charles();
     CleanRoom();
 }
 public RoomFactoryTest()
 {
     _roomFactory = new RoomFactory();
 }
 public DungeonFactory(IRoomFactory iRoomFactory, IHallwayFactory iHallwayFactory)
 {
     _iRoomFactory    = iRoomFactory;
     _iHallwayFactory = iHallwayFactory;
 }
 public RegularRoomService(IRoomFactory factory, IRoomRepository repository)
 {
     _repository = repository;
     _factory    = factory;
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MudZone"/> class.
 /// </summary>
 /// <param name="weatherStates">The weather states that can be applied to this zone.</param>
 public MudZone(IRoomFactory roomFactory, IRealm owner, IEnumerable<IWeatherState> weatherStates) : this(roomFactory, owner)
 {
     this.weatherStates = new List<IWeatherState>(weatherStates);
 }
Esempio n. 25
0
 public LevelLayout(IRoomFactory factory)
 {
     roomFactory = factory;
     _rooms      = new Dictionary <Vector2Int, IRoom>();
 }
Esempio n. 26
0
 public RoomCollection(int numberOfRooms, IRoomFactory roomFactory) : this(roomFactory, numberOfRooms, 0, 0, 0)
 {
 }
 public MazeGeneratorTests()
 {
     mg = new MazeGenerator();
     rf = new RoomFactory();
 }