Exemplo n.º 1
0
        /// <summary>
        /// Adds spawn object into the world
        /// </summary>
        private void AddSpawnObject()
        {
            if (mouse.X < 0 || mouse.Y < 0)
            {
                return;
            }

            SpawnForm    form   = new SpawnForm(this);
            DialogResult result = form.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            if (objList.Count != 0 && (int)objList[objList.Count - 1].position.X == (int)mouse.X && (int)objList[objList.Count - 1].position.Y == (int)mouse.Y)
            {
                return;
            }

            SpawnObj obj = new SpawnObj();

            obj.TeamName = form.teamName;
            obj.TeamID   = spawnList.Count;
            obj.position = new Vector2((int)mouse.X, (int)mouse.Y);
            objList.Add(obj);
            spawnList.Add(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Shows the spawn configuration dialog
        /// </summary>
        private void ShowSpawnConfig()
        {
            if (m_SpawnForm != null && m_SpawnForm.Visible)
            {
                return;
            }

            if (m_SpawnForm != null && !m_SpawnForm.Disposing)
            {
                m_SpawnForm.Dispose();
                m_SpawnForm = null;
            }

            m_SpawnForm = new SpawnForm();

            m_SpawnForm.Amount   = Pandora.Profile.Items.Amount;
            m_SpawnForm.Range    = Pandora.Profile.Items.Range;
            m_SpawnForm.MinDelay = Pandora.Profile.Items.MinDelay;
            m_SpawnForm.MaxDelay = Pandora.Profile.Items.MaxDelay;
            m_SpawnForm.Team     = Pandora.Profile.Items.Team;
            m_SpawnForm.Extra    = Pandora.Profile.Items.Extra;

            var location = PointToScreen(new Point(380, 28));

            m_SpawnForm.Location = location;

            m_SpawnForm.Closed  += m_SpawnForm_Closed;
            m_SpawnForm.OnSpawn += m_SpawnForm_OnSpawn;

            m_SpawnForm.Show();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method to generate a table with a gun form of conway's game of life.
        /// </summary>
        /// <param name="gunFormType"> One of the <see cref="GunFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given gun form. </returns>
        public int[,] GenrateTableWithForm(GunFormTypes gunFormType)
        {
            Form form = FormFactory.GenerateGun(gunFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Method to generate a table with a spaceship form of conway's game of life.
        /// </summary>
        /// <param name="spaceshipFormType"> One of the <see cref="SpaceshipFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given spaceship form. </returns>
        public int[,] GenrateTableWithForm(SpaceshipFormTypes spaceshipFormType)
        {
            Form form = FormFactory.GenerateSpaceshipForm(spaceshipFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Method to generate a table with an oscillator form of conway's game of life.
        /// </summary>
        /// <param name="oscillatorFormType"> One of the <see cref="OscillatorFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given oscillator form. </returns>
        public int[,] GenrateTableWithForm(OscillatorFormTypes oscillatorFormType)
        {
            Form form = FormFactory.GenerateOscillatorForm(oscillatorFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Method to generate a table with a stilllife form of conway's game of life.
        /// </summary>
        /// <param name="stillLifeFormType"> One of the <see cref="StillLifeFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given stilllife form. </returns>
        public int[,] GenrateTableWithForm(StillLifeFormTypes stillLifeFormType)
        {
            Form form = FormFactory.GenerateStillLifeForm(stillLifeFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }