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); }
/// <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); } } }
public UnitSection(RoomSection startingSection) { ID = Guid.NewGuid(); CurrentSection = startingSection; startingSection.SectionUnitIsIn = this; }