PlantConfigs - UQcsse3200/2023-studio-1 GitHub Wiki

PlantConfigs.java - Wiki Page

Welcome to the documentation page for the PlantConfigs.java file in our project! This file is a part of our game's entity configuration system and is responsible for defining various plant configurations that are used by the PlantFactory.

Table of Contents

  • Introduction
  • Plant Configurations
  • Usage

Introduction

The PlantConfigs.java file is an integral component of our game's entity management system. It holds a collection of plant configurations that provide essential data for creating and customizing different types of plants within the game. These configurations serve as blueprints for individual plants, dictating their characteristics and behavior.

Plant Configurations

The PlantConfigs class contains instances of the BasePlantConfig class for various plant types. Each BasePlantConfig instance is initialized with default values that define attributes such as name, plant type, lifespan of the plant, and other properties specific to the plant type (More specific properties will be added in upcoming sprints).

The available plant configurations include:

  • cosmicCob: Configuration for the Cosmic Cob plant (FOOD type).
  • aloeVera: Configuration for the Aloe Vera plant (HEALTH type).
  • hammerPlant: Configuration for the Hammer Plant (REPAIR type).
  • spaceSnapper: Configuration for the Space Snapper plant (DEFENCE type).
  • atomicAlgae: Configuration for the Atomic Algae plant (PRODUCTION type).
  • deadlyNightshade: Configuration for the Deadly Nightshade plant (DEADLY type).

Developers can utilize these pre-defined configurations as templates when creating new instances of plants. By modifying these configurations, the behavior and attributes of various plants in the game can be adjusted easily.

Usage

To use the PlantConfigs class and its associated configurations, follow these steps:

1. Import the necessary classes:

import com.csse3200.game.entities.configs.plants.PlantConfigs;

import com.csse3200.game.entities.configs.plants.BasePlantConfig;

2. Access the individual plant configurations as needed:


BasePlantConfig cosmicCobConfig = PlantConfigs.cosmicCob;

BasePlantConfig aloeVeraConfig = PlantConfigs.aloeVera;

// ... and so on