mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2025-10-30 21:07:09 +01:00
sadxca
This commit is contained in:
@@ -12,6 +12,8 @@ public class Company : MonoBehaviour
|
||||
|
||||
[SerializeField] List<Workplace> workplaces= new List<Workplace>();
|
||||
|
||||
public City GetCity() => city;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
city.AddCompany(this);
|
||||
|
||||
@@ -5,21 +5,22 @@ using UnityEngine;
|
||||
public class Workplace : MonoBehaviour
|
||||
{
|
||||
[Header("Workplace")]
|
||||
[SerializeField] int space = 1;
|
||||
[SerializeField] int space = 4;
|
||||
[SerializeField] float salary = 4.5f;
|
||||
|
||||
[SerializeField] List<Person> workers = new List<Person>();
|
||||
[SerializeField] List<Person> activeWorkers = new List<Person>(); // Workers which are currently present and working
|
||||
|
||||
[SerializeField] Company company;
|
||||
|
||||
public void SetCompany(Company _company) => company = _company;
|
||||
public void AddActiveWorker(Person worker) => activeWorkers.Add(worker);
|
||||
public void RemoveActiveWorker(Person worker) => activeWorkers.Remove(worker);
|
||||
public int GetAvaiableSpace() => space - workers.Count;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
company.AddWorkplace(this);
|
||||
company.GetCity().AddWorkplace(this);
|
||||
}
|
||||
|
||||
void Start()
|
||||
|
||||
Reference in New Issue
Block a user