Island Factory Simulator โ C++ Construction & Resource Management Simulation
๐ง Overview
Island Factory Simulator is a C++ simulation game developed as part of the Object-Oriented Programming course during the second year of my Bachelorโs degree in Computer Engineering.
The application simulates the industrial development of an island composed of multiple adjacent zones. The player is responsible for managing resources, constructing buildings, hiring and assigning workers, and issuing commands to guide the islandโs growth over time.
The project emphasizes a modular, object-oriented architecture, robust class design, and a command-driven interface to control the simulation.
๐ฏ Project Objective
The primary objective was to design and implement a fully functional construction and resource management simulator, modeling:
- Island geography divided into interconnected zones
- Building construction and operational logic
- Worker lifecycle management (hiring, assignment, dismissal)
- Resource production, consumption, and storage
- Day-based simulation with automatic and user-driven events
The game progresses in discrete days, with specific events occurring at the beginning and end of each day. Player actions are executed during the day via text-based commands.
The simulation ends when the player chooses to stop or when continuation is no longer possible due to the loss of workers or resources.
๐ Architecture & Design
The project is composed of 32+ classes, each with a well-defined responsibility.
Core Components
Ilha
Central controller responsible for island-wide logic and coordination between zones.Zona
Represents a specific zone of the island, containing information about resources, buildings, and workers.Edifรญcio
Stores building-related data such as storage capacity and operational status.Trabalhador
Represents workers, including identification, role, and behavior.GameData
Acts as an intermediary between the user interface and the simulation logic, managing game state and delegating operations.Interface
Handles user interaction, command parsing, and visualization of the island state.
๐งฉ Object-Oriented Concepts Applied
- Encapsulation โ Controlled access to internal state through class interfaces
- Inheritance โ Shared behavior across specialized zone and entity types
- Polymorphism โ Zone- and worker-specific behavior through method overriding
- Separation of Concerns โ Clear distinction between logic, interface, and data
โ๏ธ Simulation Flow
- Game state is initialized in
main.cpp - User inputs commands through the text-based interface
- Commands are interpreted and validated by
GameData - Island and zone states are updated accordingly
- Automatic events execute at day start and end
This loop continues until an end condition is reached.
๐ Technology Stack
- Language: C++
- Paradigm: Object-Oriented Programming
- Interface: Command-line (text-based)
- Architecture: Modular, class-driven design
๐ Source Code
๐ Island Factory Simulator โ GitHub Repository
๐ Possible Future Improvements
- Graphical user interface (GUI)
- Save/load system with persistent state
- Expanded building, resource, and worker types
- Improved AI-driven behavior
- Performance optimizations for larger simulations
๐ง What This Project Demonstrates
- Strong understanding of C++ and object-oriented design
- Ability to model complex systems and interactions
- Experience managing a medium-sized codebase
- Implementation of deterministic, command-driven simulations
- Clean architecture with extensibility in mind