Example #1
0
        private void FogOfWar()
        {
            if (CellMap.Find(_LocationList, _Location).ID != null)
            {
                if (CellMap.Find(_Nation[NationSelect.SelectedIndex].Vision, _Location).ID == null)
                {
                    _Nation[NationSelect.SelectedIndex].Vision.Add(new CellMap(_Location, CellMap.Find(_Nation[NationSelect.SelectedIndex].Vision, _Location).Properties));
                    CellMap.Sort(_Nation[NationSelect.SelectedIndex].Vision);
                }
                else
                {
                    CellMap.Find(_Nation[NationSelect.SelectedIndex].Vision, _Location).State = CellMap.States.Visible;
                }
            }

            //for (int dir = 0; dir < _GridType.Directions; dir++)
            //{
            //	CellMap ThisCell = CellMap.Find(_LocationList, _Location.Neighbor(dir).ToAxial());
            //	//	CellMap PrevCell = CellMap.Find(_LocationList, _Location.ToAxial());

            //	if (CellMap.Find(_Nation.Vision, ThisCell.Coords).ID == null)
            //	{
            //		_Nation.Vision.Add(new CellMap(ThisCell.Coords, CellMap.Find(_LocationList, ThisCell.Coords).Properties));
            //		CellMap.Sort(_Nation.Vision);
            //	}
            //	else
            //	{
            //		CellMap.Find(_Nation.Vision, ThisCell.Coords).State = CellMap.States.Shadow;
            //	}
            //}

            CoordinatesText.Text = $"Координаты: {_Location.ToString()}";
        }
Example #2
0
        private void Edit()
        {
            ButtonMapSave.Enabled = true;

            string[] Prop = new string[3] {
                "", "", ""
            };

            if ((string)BackgroundSelect.SelectedItem != "Empty")
            {
                Prop[0] = (string)BackgroundSelect.SelectedItem;
            }
            else
            {
                Prop[0] = CellMap.Find(_LocationList, _Location).Properties[0];
            }
            if (RoadCheck.Checked)
            {
                Prop[1] = DrawPath(1);
            }
            if (RiverCheck.Checked)
            {
                Prop[2] = DrawPath(2);
            }

            if (CellMap.Find(_LocationList, _Location).ID == null)
            {
                _LocationList.Add(new CellMap(_Location, Prop));
                CellMap.Sort(_LocationList);
            }
            else
            {
                CellMap.Find(_LocationList, _Location).SetProp(Prop);
            }
        }