mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2025-10-30 12:57:09 +01:00
sadxca
This commit is contained in:
@@ -6,7 +6,7 @@ public class House : MonoBehaviour
|
||||
{
|
||||
[Header("House")]
|
||||
[SerializeField]
|
||||
int space = 1;
|
||||
int space = 4;
|
||||
|
||||
[SerializeField]
|
||||
List<Person> persons = new List<Person>();
|
||||
@@ -14,18 +14,22 @@ public class House : MonoBehaviour
|
||||
[SerializeField]
|
||||
City city;
|
||||
|
||||
public int GetAvaiableSpace() => space - persons.Count;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
city.AddHouse(this);
|
||||
}
|
||||
|
||||
public void AddPerson(Person person)
|
||||
public bool AddPerson(Person person)
|
||||
{
|
||||
if (!persons.Contains(person) && persons.Count < space)
|
||||
{
|
||||
persons.Add(person);
|
||||
Debug.Log(person.GetFullName() + " now lives in house");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void RemovePerson(Person person)
|
||||
|
||||
Reference in New Issue
Block a user