void UpdateSelection(IntVector3 p) { IntVector3 start; var end = p.Truncate(new IntGrid3(m_game.Environment.Size)); switch (m_selectionMode) { case MapSelectionMode.Rectangle: start = new IntVector3(this.Selection.SelectionStart.ToIntVector2(), end.Z); break; case MapSelectionMode.Box: start = this.Selection.SelectionStart; break; case MapSelectionMode.Point: start = this.Selection.SelectionStart; break; default: throw new Exception(); } this.Selection = new MapSelection(start, end); }