public bool IsGridPositionFree(Vector3 position) { // check if it is taken by blocking objects if (!area.IsGridPositionFree(position)) { return(false); } // check if it is taken by a player foreach (KeyValuePair <CharacterSheet, Vector3> combatant in teams[Helpers.Teams.Home]) { if (combatant.Value.Equals(position)) { return(false); } } // check if it is taken by a player foreach (KeyValuePair <CharacterSheet, Vector3> combatant in teams[Helpers.Teams.Away]) { if (combatant.Value.Equals(position)) { return(false); } } // no other things could block a grid position return(true); }