Commented buildings

This commit is contained in:
Aaron Moser
2023-07-23 16:19:49 +02:00
parent 0504837cce
commit b58a45657e
15 changed files with 3580 additions and 4027 deletions

View File

@@ -1,25 +1,50 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/// <summary>
/// Class <c>BuildingValues</c> is a container to transport data.
/// <value></value>
/// <value>RunningCost is the running cost of a building.</value>
/// <value>ScienceCapacity is the amount of science produced by the building.</value>
/// <value>FoodCapacity is the amount of food produced by the building.</value>
/// <value>IndustrialCapacity is the amount of industry produced by the building.</value>
/// <value>MoneyCapacity is the amount of money produced by the building.</value>
/// <value>MilitaryPower is the amount of military produced by the building.</value>
/// </summary>
/**
* @section DESCRIPTION
*
* Class is a container to transport data about building.
*/
public class BuildingValues
{
/**
* RunningCost is the running cost of a building.
*/
public int RunningCost = 0;
/**
* ScienceCapacity is the amount of science produced by the building.
*/
public int ScienceCapacity = 0;
/**
* FoodCapacity is the amount of food produced by the building.
*/
public int FoodCapacity = 0;
/**
* IndustrialCapacity is the amount of industry produced by the building.
*/
public int IndustrialCapacity = 0;
/**
* MoneyCapacity is the amount of money produced by the building.
*/
public int MoneyCapacity = 0;
/**
* MilitaryPower is the amount of military produced by the building.
*/
public int MilitaryPower = 0;
}
}

View File

@@ -1,11 +1,26 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Food
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NBuilding
{
/**
* @section DESCRIPTION
*
* Class contains definition of farm building.
*/
public class Farm : ABuilding
{
/**
* Creates a farm, which produces 3 food.
*/
public Farm()
{
SetFoodCapacity(3);

View File

@@ -1,71 +1,121 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/// <summary>
/// Interface <c>IBuilding</c> defines the functions for the buildings.
/// <param><c>iId</c> is the id of a player.</param>
/// <returns>Returns <c>all values</c> of all buildings at star system of player.</returns>
/// More efficient because it iterates only once through list instead of 6 times.
/// </summary>
/**
* @section DESCRIPTION
*
* Interface defines the functions for the buildings.
*/
public interface IBuilding
{
//----------------------------------------------------------------------------
// Getters
/// <summary>
/// Function <c>GetRunningCost</c> returns the running cost if the building is running.
/// </summary>
/**
* Function returns the running cost if the building is running.
*/
public int GetRunningCost();
/// <summary>
/// Function <c>GetScienceCapacity</c> returns the amount of science the building produces if it is running.
/// </summary>
/**
* Function returns the amount of science the building produces if it is running.
*/
public int GetScienceCapacity();
/// <summary>
/// Function <c>GetFoodCapacity</c> returns the amount of food the building produces if it is running.
/// </summary>
/**
* Function returns the amount of food the building produces if it is running.
*/
public int GetFoodCapacity();
/// <summary>
/// Function <c>GetIndustrialCapacity</c> returns the amount of industrial the building produces if it is running.
/// </summary>
/**
* Function returns the amount of industrial the building produces if it is running.
*/
public int GetIndustrialCapacity();
/// <summary>
/// Function <c>GetMoneyCapacity</c> returns the amount of money the building produces if it is running.
/// </summary>
/**
* Function returns the amount of money the building produces if it is running.
*/
public int GetMoneyCapacity();
/// <summary>
/// Function <c>GetMilitaryPower</c> returns the amount of power the building produces if it is running.
/// </summary>
/**
* Function returns the amount of power the building produces if it is running.
*/
public int GetMilitaryPower();
/// <summary>
/// Function <c>IsRunning</c> returns true if the building is running, false if the building is not running.
/// </summary>
/**
* Function returns true if the building is running, false if the building is not running.
*/
public bool IsRunning();
/// <summary>
/// Function <c>GetId</c> returns id of building.
/// </summary>
/**
* Function returns id of building.
*/
public ABuilding.BuildingID GetId();
//----------------------------------------------------------------------------
// Setters
/**
*
* @param newRunningCost, new costs to set running costs to.
*/
public void SetRunningCost(int newRunningCost);
/**
* Sets science capacity.
*
* @param newScienceCapacity, new science value to set.
*/
public void SetScienceCapacity(int newScienceCapacity);
/**
* Sets food capacity.
*
* @param newFoodCapacity, new food value to set.
*/
public void SetFoodCapacity(int newFoodCapacity);
/**
* Sets industrial capacity.
*
* @param newIndustrialCapacity, new industrial value to set.
*/
public void SetIndustrialCapacity(int newIndustrialCapacity);
/**
* Sets industrial capacity.
*
* @param newMoneyCapacity, new money value to set.
*/
public void SetMoneyCapacity(int newMoneyCapacity);
/**
* Sets military capacity.
*
* @param newMilitaryPower, new military power value to set.
*/
public void SetMilitaryPower(int newMilitaryPower);
/**
* Sets building running or not.
*
* @param newRunning, true if building should run, producing resources, false if not.
*/
public void SetRunning(bool newRunning);
/**
* Sets id of building.
*
* @param newId, new id of building.
*/
public void SetId(ABuilding.BuildingID newId);
//----------------------------------------------------------------------------

View File

@@ -1,10 +1,25 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Industry
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/**
* @section DESCRIPTION
*
* Class contains definition of smeltery building.
*/
public class Smeltery : ABuilding
{
/**
* Creates a smeltery, which produces 3 industrial capacity.
*/
public Smeltery()
{
SetIndustrialCapacity(3);

View File

@@ -1,10 +1,25 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Military
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/**
* @section DESCRIPTION
*
* Class contains definition of armory building.
*/
public class Armory : ABuilding
{
/**
* Creates an armory, which produces 3 military power.
*/
public Armory()
{
SetMilitaryPower(3);

View File

@@ -1,10 +1,25 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Misc
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/**
* @section DESCRIPTION
*
* Class contains definition of spaceport building.
*/
public class Spaceport : ABuilding
{
/**
* Creates spaceport building.
*/
public Spaceport() { }
}
}

View File

@@ -1,13 +1,25 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Money
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/// <summary>
/// Class <c>Market</c> defines the class for market.
/// </summary>
/**
* @section DESCRIPTION
*
* Class contains definition of market building.
*/
public class Market : ABuilding
{
/**
* Creates a market, which produces 3 money.
*/
public Market()
{
SetMoneyCapacity(3);

View File

@@ -1,10 +1,25 @@
/**
* @file
*
* @author Aaron Moser
*
* @package Assets.Scripts.Buildings.Science
*/
using System.Collections;
using System.Collections.Generic;
namespace NBuilding
{
/**
* @section DESCRIPTION
*
* Class contains definition of university building.
*/
public class University : ABuilding
{
/**
* Creates an university, which produces 3 science.
*/
public University()
{
SetScienceCapacity(3);