// Deselect the currently selected ally private void DeselectAlly(InputManager input, Point checkCoords) { if (m_map.WalkableGrid[checkCoords.X, checkCoords.Y] > 0) { if (input.LeftPressed && m_currChar != null) { m_currChar.IsSelected = false; m_currChar = null; } } }
} // Set Colours public CharHealthBar SetParentOfBar(GameChar parent) { m_parentChar = parent; return(this); } // Set Character Parent
// If an ally is selected, deselect all others private void SelectAlly(InputManager input) { for (int i = 0; i < m_characters.Count; i++) { if (m_characters[i].SelectionCircle.Contains(m_mousePos)) { if (input.LeftPressed) { m_currChar = m_characters[i]; m_characters[i].IsSelected = true; for (int k = 0; k < m_characters.Count; k++) { if (k != i) { m_characters[k].IsSelected = false; } } } } } #region Selection Keys if (input.Keys.IsKeyDown(Keys.D1)) { for (int i = 0; i < m_characters.Count; i++) { if (i == 0) { m_characters[i].IsSelected = true; } else { m_characters[i].IsSelected = false; } } } if (input.Keys.IsKeyDown(Keys.D2)) { for (int i = 0; i < m_characters.Count; i++) { if (i == 1) { m_characters[i].IsSelected = true; } else { m_characters[i].IsSelected = false; } } } if (input.Keys.IsKeyDown(Keys.D3)) { for (int i = 0; i < m_characters.Count; i++) { if (i == 2) { m_characters[i].IsSelected = true; } else { m_characters[i].IsSelected = false; } } } #endregion }