Exemplo n.º 1
0
        public void ctor(MountainModel model, Vector3 center, Color[] starColors1, Color[] starColors2)
        {
            particles = new List <Particle>();
            EntityCtor();

            this.model = model;
            Visible    = false;
            Matrix matrix = Matrix.CreateRotationZ(0.4f);

            if (starColors1.Length != 0)
            {
                for (int i = 0; i < 20; i++)
                {
                    Add(new Particle(OVR.Atlas["star"], Calc.Random.Choose(starColors1), center, 1f, matrix));
                }
                for (int i = 0; i < 30; i++)
                {
                    Add(new Particle(OVR.Atlas["snow"], Calc.Random.Choose(starColors1), center, 0.3f, matrix));
                }
            }
            matrix = Matrix.CreateRotationZ(0.8f) * Matrix.CreateRotationX(0.4f);
            if (starColors2.Length != 0)
            {
                for (int i = 0; i < 20; i++)
                {
                    Add(new Particle(OVR.Atlas["star"], Calc.Random.Choose(starColors2), center, 1f, matrix));
                }
                for (int i = 0; i < 30; i++)
                {
                    Add(new Particle(OVR.Atlas["snow"], Calc.Random.Choose(starColors2), center, 0.3f, matrix));
                }
            }
        }
        public void OneTimeSetUp()
        {
            _mountain = new Mountain
            {
                Id     = MockDomainRoot.EntityId,
                Name   = "Name",
                Height = new Height {
                    Metres = 1
                },
                Location = new Location {
                    GridRef = new GridRef("NM123456"), Latitude = 2, Longitude = 3
                },
                Prominence = new Prominence {
                    Metres = 4, KeyCol = "KeyCol", KeyColHeight = new Height {
                        Metres = 5
                    }
                },
                Feature      = "Feature",
                Observations = "Observations",
                ListIds      = MockDomainRoot.EntityIds,
                MapIds       = MockDomainRoot.EntityIds,
                SectionId    = MockDomainRoot.EntityId,
                CountryId    = MockDomainRoot.EntityId
            };

            _sut = new MountainModel(_mountain, new MockDomainRoot());
        }
Exemplo n.º 3
0
        public MountainInformationForm(MountainModel model)
        {
            InitializeComponent();

            mountain = model;

            InformationsDataGetter();
        }
Exemplo n.º 4
0
        private void difLoadMountainButton_Click(object sender, EventArgs e)
        {
            MountainModel mm = new MountainModel();

            mm = (MountainModel)difMountainsListbox.SelectedItem;

            MountainInformationForm frm = new MountainInformationForm(mm);

            frm.Show();
        }
Exemplo n.º 5
0
        public void MountainInserted(MountainModel myMountain)
        {
            availibleMountains.Add(myMountain);

            DifficultySorter(availibleMountains, availibleDifficulties);

            CountrySorter(availibleMountains, availibleCountries);

            WireUpLists();
        }
Exemplo n.º 6
0
        private void mmfLoadMountainButton_Click(object sender, EventArgs e)
        {
            MountainModel mm = (MountainModel)selectMountainComboBox.SelectedItem;

            if (mm != null)
            {
                MountainInformationForm frm = new MountainInformationForm(mm);
                frm.Show();
            }
        }
Exemplo n.º 7
0
        public void UpdateStatus(MountainModel model)
        {
            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString("Mountains")))
            {
                var m = new DynamicParameters();
                m.Add("@id", model.Id);
                m.Add("MountainFinished", model.MountainFinished);

                connection.Execute("dbo.spMountains_Update", m, commandType: CommandType.StoredProcedure);
            }
        }
Exemplo n.º 8
0
        public void RemoveMountain(MountainModel model)
        {
            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString("Mountains")))
            {
                if (model != null)
                {
                    var m = new DynamicParameters();

                    m.Add("@MountainName", model.MountainName);

                    connection.Execute("dbo.spMountains_Remove", m, commandType: CommandType.StoredProcedure);
                }
            }
        }
Exemplo n.º 9
0
        private void removeMountainMenuButton_Click(object sender, EventArgs e)
        {
            DataAccess db = new DataAccess();

            MountainModel selectedMountain = new MountainModel();

            selectedMountain = (MountainModel)selectMountainComboBox.SelectedItem;

            db.RemoveMountain(selectedMountain);

            DataGetter();

            WireUpLists();
        }
Exemplo n.º 10
0
        private void removeFromFinishedButton_Click(object sender, EventArgs e)
        {
            MountainModel m = (MountainModel)finishedToursListbox.SelectedItem;

            if (!(m == null))
            {
                m.MountainFinished = false;

                UpdateStats(m);

                finishedTours.Remove(m);

                notFinishedTours.Add(m);

                WireUpStatistics();
            }
        }
Exemplo n.º 11
0
        private void addToFinishedButton_Click(object sender, EventArgs e)
        {
            MountainModel m = (MountainModel)notFinishedToursListbox.SelectedItem;

            //finishedTours.Add((MountainModel)notFinishedToursListbox.SelectedItem);
            //hore druha moznost ?? vyskusat( ale asi najprv pridat a potom zmazat, naopak by neslo)

            m.MountainFinished = true;

            UpdateStats(m);

            notFinishedTours.Remove(m);

            finishedTours.Add(m);

            WireUpStatistics();
        }
Exemplo n.º 12
0
        public MountainModel CreateMountain(MountainModel model)
        {
            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString("Mountains")))
            // connection, using statement is destroyed after the code inside is done so we dont leave out anything to be seen
            {
                var m = new DynamicParameters();
                m.Add("MountainName", model.MountainName);
                m.Add("MountainHeight", model.MountainHeight);
                m.Add("MountainDifficulty", model.MountainDifficulty);
                m.Add("MountainTourStart", model.MountainTimeOfTour);
                m.Add("MountainTimeOfTour", model.MountainTimeOfTour);
                m.Add("MountainCountryName", model.MountainCountryName);
                m.Add("@id", 0, dbType: DbType.Int32, direction: ParameterDirection.Output);

                connection.Execute("dbo.spMountains_Insert", m, commandType: CommandType.StoredProcedure);

                model.Id = m.Get <int>("@id");

                return(model);
            }
        }
Exemplo n.º 13
0
        public void UpdateStats(MountainModel model)
        {
            DataAccess db = new DataAccess();

            db.UpdateStatus(model);
        }
Exemplo n.º 14
0
 public patch_MoonParticle3D(MountainModel model, Vector3 center, Color[] starColors1, Color[] starColors2) : base(model, center)
 {
     // dummy constructor
 }