Overview
TheBuilding data class represents a physical building or facility on the TecNM campus, including its location information, purpose, and distance from the user’s current position.
Data Class Definition
Properties
Unique identifier for the building.
Official name or designation of the building.Example:
"Edificio A", "Laboratorio 3", "Cafetería Central"Brief description of the building’s purpose or function.Example:
"Aulas generales", "Prácticas de computación"Classification or type of the building.Common values:
"Aulas"- Classroom buildings"Labs"- Laboratory facilities"Cafetería"- Food service areas
Distance from the user’s current location to the building, formatted as a string with units.Example:
"120 m", "180 m"Usage Example
Example from FakeData
Usage in the App
TheBuilding model is primarily used in the Map Screen (MapScreen.kt):
Campus Locator Features
- Building Search: Users can search for buildings by name through the search bar
-
Category Filtering: Buildings can be filtered by category:
- “Todos” (All)
- “Aulas” (Classrooms)
- “Labs” (Laboratories)
- “Cafetería” (Cafeteria)
-
Nearby Buildings List: Displays buildings sorted by proximity with:
- Building name prominently displayed
- Description and distance shown as subtitle (e.g., “Aulas generales · 120 m”)
- Category-specific icon:
Icons.Outlined.Apartmentfor classroom buildingsIcons.Outlined.Sciencefor laboratoriesIcons.Outlined.Coffeefor cafeteria
- Color-coded icons based on building type
-
Campus Map Visualization: Buildings are rendered on an interactive campus map with:
- Color-coded boxes representing each building
- Building names displayed on the map
- Visual indicators for building locations
Integration with ClassSession
Building information helps students locate their classes:- ClassSession’s
classroomproperty references rooms within buildings - Students can use the map to find the building where their next class is held
- Distance information helps with navigation and time management between classes
Related Models
- ClassSession - Classes that take place in campus buildings
- Student - Students navigating between buildings
