Beispiel #1
0
 private bool IsInTableBounds(Position.Position position)
 {
     return(position.Location.X <= Table.Width &&
            position.Location.X >= 0 &&
            position.Location.Y >= 0 &&
            position.Location.Y <= Table.Height);
 }
Beispiel #2
0
 public void SetCurrentPosition(Position.Position position)
 {
     if (IsNewPositionValid(position))
     {
         CurrentPosition = position;
     }
 }
Beispiel #3
0
 private bool IsNewPositionValid(Position.Position position)
 {
     return(position != null && IsInTableBounds(position));
 }