-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathPlantInstance.cs
More file actions
77 lines (67 loc) · 2.18 KB
/
PlantInstance.cs
File metadata and controls
77 lines (67 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#if (IL2CPPMELON || IL2CPPBEPINEX)
using S1Growing = Il2CppScheduleOne.Growing;
#elif (MONOMELON || MONOBEPINEX)
using S1Growing = ScheduleOne.Growing;
#endif
using S1API.Internal.Utils;
using S1API.Items;
using UnityEngine;
namespace S1API.Growing
{
/// <summary>
/// Represents an instance of a growing plant in the world.
/// </summary>
public class PlantInstance
{
/// <summary>
/// INTERNAL: The in-game Plant object.
/// </summary>
internal readonly S1Growing.Plant S1Plant;
/// <summary>
/// INTERNAL: Create a wrapper around an existing Plant.
/// </summary>
/// <param name="plant">The in-game Plant to wrap.</param>
internal PlantInstance(S1Growing.Plant plant)
{
S1Plant = plant;
}
/// <summary>
/// The current growth stage as a float from 0.0 to 1.0.
/// </summary>
public float NormalizedGrowth =>
S1Plant.NormalizedGrowthProgress;
/// <summary>
/// Whether the plant is fully grown.
/// </summary>
public bool IsFullyGrown =>
S1Plant.IsFullyGrown;
/// <summary>
/// The SeedDefinition that this plant originated from.
/// </summary>
public SeedDefinition SeedDefinition =>
new SeedDefinition(S1Plant.SeedDefinition);
/// <summary>
/// The quality level of this plant.
/// </summary>
public float Quality =>
S1Plant.QualityLevel;
/// <summary>
/// The yield level (amount) of this plant.
/// </summary>
public float Yield =>
S1Plant.YieldLevel;
/// <summary>
/// The GameObject of the plant.
/// </summary>
public GameObject GameObject =>
S1Plant.gameObject;
/// <summary>
/// Destroys this plant in-game.
/// </summary>
/// <param name="dropScraps">Whether to drop trash scraps.</param>
public void Destroy(bool dropScraps = false)
{
S1Plant.Destroy(dropScraps);
}
}
}