Beispiel #1
0
        public bool MoveUnit(RoomSection sectionToMoveTo)
        {
            CurrentSection.Rect.Fill       = CurrentSection.NormalBrush;
            CurrentSection.SectionUnitIsIn = null;

            CurrentSection = sectionToMoveTo;
            sectionToMoveTo.SectionUnitIsIn = this;

            CurrentSection.Rect.Fill = Brushes.Red;

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new when first created based on height and width
        /// </summary>
        private void CreateRoom()
        {
            Sections = new RoomSection[Height, Width];

            for (int x = 0; x < Height; x++)
            {
                for (int y = 0; y < Width; y++)
                {
                    Sections[x, y] = new RoomSection(x, y);
                }
            }
        }
Beispiel #3
0
 public UnitSection(RoomSection startingSection)
 {
     ID             = Guid.NewGuid();
     CurrentSection = startingSection;
     startingSection.SectionUnitIsIn = this;
 }