Ejemplo n.º 1
0
        /// <summary>
        /// Creates the car.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="type">The type.</param>
        /// <returns>
        /// The created ViewModel
        /// </returns>
        public AbstractCarViewModel CreateNewObject(VRPosition position, int id, int type)
        {
            AbstractCarViewModel car = null;
            switch (type)
            {
                case (int)CarEnum.Normal:
                    car = new NormalCarViewModel(position, id);
                    break;

                case (int)CarEnum.Police:
                    car = new PoliceCarViewModel(position, id);
                    break;

                case (int)CarEnum.Ambulance:
                    car = new AmbulanceCarViewModel(position, id);
                    break;

                case (int)CarEnum.Firetruck:
                    car = new FiretruckCarViewModel(position, id);
                    break;

                default:
                    break;
            }

            CarView view = new CarView(car);
            this.LinkMVVM(view, car);
            return car;
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     position1 = new VRPosition(42, 42, 42);
     scale = new VRScale(100, 100);
     building1 = new BuildingViewModel(position1, scale, 1);
     building2 = new BuildingViewModel(position1, scale, 2);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CharacterViewModel" /> class.
        /// </summary>
        /// <param name="pos">The position.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="emotion">The emotion.</param>
        /// <param name="action">The action.</param>
        /// <param name="color">The color.</param>
        public CharacterViewModel(VRPosition pos, int id, int emotion, int action, string color)
        {
            this.characterModel = new CharacterModel(pos, id, emotion, action, color);
            this.Model = this.characterModel;

            Log.Logger.GetInstance().Warning("New Char at: " + pos.X + ":" + pos.Y);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets the position.
 /// </summary>
 /// <param name="pos">The position.</param>
 public void SetPosition(VRPosition pos)
 {
     Thickness margin = this.Margin;
     margin.Left = pos.X;
     margin.Top = pos.Y;
     this.Margin = margin;
 }
Ejemplo n.º 5
0
 public void SetUp()
 {
     position1 = new VRPosition(42, 42, 42);
     seat1 = new SeatViewModel(position1, 1);
     seat2 = new SeatViewModel(position1, 2);
     factory = new BenchFactory();
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates the new bench.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="seatIDs">The seat i ds.</param>
        /// <returns>
        /// the viewModel of the bench.
        /// </returns>
        public BenchViewModel CreateNewObject(VRPosition position, int id, Collection<int> seatIDs)
        {
            Collection<SeatViewModel> svmList = new Collection<SeatViewModel>();

            BenchViewModel viewModel = new BenchViewModel(position, id, svmList);
            return viewModel;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates the new object.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 /// <returns>A new object</returns>
 public SeatViewModel CreateNewObject(VRPosition pos, int id)
 {
     SeatView view = new SeatView();
     SeatViewModel viewModel = new SeatViewModel(pos, id);
     this.LinkMVVM(view, viewModel);
     return viewModel;
 }
Ejemplo n.º 8
0
 public void SetUp()
 {
     position1 = new VRPosition(42, 42, 42);
     scale = new VRScale(100, 100);
     tree1 = new TreeViewModel(position1, 1);
     tree2 = new TreeViewModel(position1, 2);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Creates the new tree.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <param name="id">The identifier.</param>
        /// <returns>
        /// the view-model of the tree
        /// </returns>
        public TreeViewModel CreateNewObject(VRPosition position, int id)
        {
            TreeView view = new TreeView();
            TreeViewModel viewModel = new TreeViewModel(position, id);

            this.LinkMVVM(view, viewModel);
            return viewModel;
        }
Ejemplo n.º 10
0
 public void SetPositionBenchTest()
 {
     bench1.SetSeats();
     VRPosition actualPosition = bench1.GetSeatWithID(5).Position;
     VRPosition expectedPosition = new VRPosition(position1.X, position1.Y);
     Assert.AreEqual(expectedPosition.X, actualPosition.X);
     Assert.AreEqual(expectedPosition.Y, actualPosition.Y);
 }
Ejemplo n.º 11
0
 public void SetPositionWhileHiddenTest()
 {
     VRPosition pos = new VRPosition(200, 100);
     Assert.AreEqual("Hidden", viewModel.Visible);
     viewModel.Position = pos;
     Assert.AreEqual("Visible", viewModel.Visible);
     Assert.AreEqual(pos, viewModel.Position);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildingViewModel" /> class.
        /// </summary>
        /// <param name="pos">The position.</param>
        /// <param name="scale">The scale.</param>
        /// <param name="id">The identifier.</param>
        public BuildingViewModel(VRPosition pos, VRScale scale, int id)
        {
            Log.Logger.GetInstance().Warning("1scale = " + scale.Width);
            Log.Logger.GetInstance().Debug("new builView at (" + pos.X + ":" + pos.Y + ":" + pos.Rotation + ") with w=" + scale.Width + " and h=" + scale.Height);

            this.buildingModel = new BuildingModel(pos, scale, id);
            this.Model = this.buildingModel;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Creates the new object.
        /// </summary>
        /// <param name="pos">The position.</param>
        /// <returns>
        /// The new object
        /// </returns>
        public PatientViewModel CreateNewObject(VRPosition pos)
        {
            PatientViewModel character = new PatientViewModel(pos);
            PatientView view = new PatientView();

            this.LinkMVVM(view, character);
            return character;
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TVModel"/> class.
        /// </summary>
        /// <param name="pos">The position.</param>
        /// <param name="id">The identifier.</param>
        public TVModel(VRPosition pos, int id)
            : base(pos, new VRScale(SizeEnum.DefaultVRObjectSize), id)
        {
            this.IsOn = false;

            this.Scale = new VRScale(SizeEnum.CharacterSize);
            this.Icon = ImageEnum.TvIcon.GetImageBrush();
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterModel" /> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="emotion">The emotion.</param>
 /// <param name="action">The action.</param>
 /// <param name="color">The color.</param>
 public CharacterModel(VRPosition pos, int id, int emotion, int action, string color)
     : base(pos, new VRScale(SizeEnum.DefaultVRObjectSize), id)
 {
     this.SetEmotion(emotion);
     this.SetAction(action);
     this.BackgroundColor = color;
     this.Visible = "Hidden";
 }
Ejemplo n.º 16
0
        /// <summary>
        /// Creates the new object.
        /// </summary>
        /// <param name="pos">The position.</param>
        /// <param name="id">The identifier.</param>
        /// <param name="emotion">The emotion.</param>
        /// <param name="action">The action.</param>
        /// <returns>The new object</returns>
        public CharacterViewModel CreateNewObject(VRPosition pos, int id, int emotion, int action)
        {
            string color = this.RandomGRB();
            CharacterViewModel character = new CharacterViewModel(pos, id, emotion, action, color);
            CharacterView view = new CharacterView(character);

            this.LinkMVVM(view, character);
            return character;
        }
Ejemplo n.º 17
0
 public void SetUp()
 {
     position1 = new VRPosition(42, 42, 360);
     position2 = new VRPosition(42, 42, 360);
     position3 = new VRPosition(24, 42, 360);
     position4 = new VRPosition(42, 24, 360);
     position5 = new VRPosition(42, 42, 300);
     position6 = new VRPosition(84, 84, 360);
     position7 = new VRPosition(42, 42);
 }
Ejemplo n.º 18
0
        /// <summary>
        /// Creates the new building.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <param name="scale">The scale.</param>
        /// <param name="id">The identifier.</param>
        /// <returns>
        /// the view-model of the building
        /// </returns>
        public BuildingViewModel CreateNewObject(VRPosition position, VRScale scale, int id)
        {
            BuildingView view = new BuildingView();
            Log.Logger.GetInstance().Warning("0scale = " + scale.Width);
            Log.Logger.GetInstance().Error("Building pos " + position.X + " " + position.Y);
            BuildingViewModel viewModel = new BuildingViewModel(position, scale, id);

            this.LinkMVVM(view, viewModel);
            return viewModel;
        }
Ejemplo n.º 19
0
        public void SetUp()
        {
            position1 = new VRPosition(42, 42, 42);

            svm1 = new SeatViewModel(position1, 5);
            svm2 = new SeatViewModel(position1, 4);
            Collection<SeatViewModel> seatList = new Collection<SeatViewModel>();
            seatList.Add(svm1);
            seatList.Add(svm2);
            bench1 = new BenchViewModel(position1, 1, seatList);
            bench2 = new BenchViewModel(position1, 2, seatList);
        }
Ejemplo n.º 20
0
 public void SetUp()
 {
     position = new VRPosition(42, 42, 42);
     patient = new PatientViewModel(position);
 }
Ejemplo n.º 21
0
        public void MapSetMarginTest()
        {
            VRPosition pos = new VRPosition(500, 499);

            Assert.AreNotEqual(-500.0d, map.GetCanvas().Margin.Left);

            map.SetMargin(pos);

            Assert.AreEqual(-500.0d, map.GetCanvas().Margin.Left);
            Assert.AreEqual(-499.0d, map.GetCanvas().Margin.Top);
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildingModel" /> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="scale">The scale.</param>
 /// <param name="id">The identifier.</param>
 public BuildingModel(VRPosition pos, VRScale scale, int id)
     : base(pos, scale, id)
 {
 }
Ejemplo n.º 23
0
 public void SetUp()
 {
     position = new VRPosition(1, 1, 0);
     bench = new BenchModel(position, 11);
 }
Ejemplo n.º 24
0
 public void SetUp()
 {
     position = new VRPosition(100, 100, 230);
     tv = new TVModel(position, 10);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TreeModel"/> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 public TreeModel(VRPosition pos, int id)
     : base(pos, new VRScale(SizeEnum.Unity.TreeSize()), id)
 {
     this.Image = ImageEnum.TreeIcon.GetImageBrush();
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractCarViewModel" /> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 public AbstractCarViewModel(VRPosition pos, int id)
     : base()
 {
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SeatViewModel" /> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 public SeatViewModel(VRPosition pos, int id)
 {
     this.seatModel = new SeatModel(pos, id);
     this.Model = this.seatModel;
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BenchViewModel" /> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 /// <param name="svmList">The SVM list.</param>
 public BenchViewModel(VRPosition pos, int id, Collection<SeatViewModel> svmList)
 {
     this.benchModel = new BenchModel(pos, id);
     this.Model = this.benchModel;
     this.SeatList = svmList;
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FiretruckCarViewModel"/> class.
 /// </summary>
 /// <param name="pos">The position.</param>
 /// <param name="id">The identifier.</param>
 public FiretruckCarViewModel(VRPosition pos, int id)
     : base(pos, id)
 {
     this.CarModel = new FiretruckCarModel(pos, id);
     this.Model = this.CarModel;
 }
Ejemplo n.º 30
0
 public void SetUp()
 {
     position1 = new VRPosition(42, 42, 42);
     tv1 = new TVViewModel(position1, 1);
     tv2 = new TVViewModel(position1, 2);
 }