DayZ 1.24
Loading...
Searching...
No Matches
ActionRemovePlant Class Reference
Inheritance diagram for ActionRemovePlant:
[legend]
Collaboration diagram for ActionRemovePlant:
[legend]

Private Member Functions

void ActionRemovePlant ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnExecuteServer (ActionData action_data)
 

Private Attributes

PlantBase m_Plant
 

Detailed Description

Definition at line 1 of file ActionRemovePlant.c.

Constructor & Destructor Documentation

◆ ActionRemovePlant()

void ActionRemovePlant::ActionRemovePlant ( )
inlineprivate

Definition at line 5 of file ActionRemovePlant.c.

6 {
7 m_Text = "#remove_plant";
8 }
string m_Text
Definition ActionBase.c:49

References m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionRemovePlant::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 21 of file ActionRemovePlant.c.

22 {
24 if (Class.CastTo(garden_base, target.GetObject()))
25 {
26 Slot slot;
27
29 garden_base.GetActionComponentNameList(target.GetComponentIndex(), selections);
30 string selection;
31
32 for (int s = 0; s < selections.Count(); s++)
33 {
34 selection = selections[s];
35 slot = garden_base.GetSlotBySelection(selection);
36 if (slot)
37 break;
38 }
39
40 if (slot && slot.GetPlant())
41 {
42 m_Plant = PlantBase.Cast(slot.GetPlant());
43 if (m_Plant.IsGrowing() || m_Plant.IsDry() || !m_Plant.HasCrops() || m_Plant.IsSpoiled())
44 return true;
45 }
46 }
47 return false;
48 /*Object targetObject = target.GetObject();
49 if ( targetObject != NULL && targetObject.IsInherited(PlantBase) )
50 {
51 PlantBase plant = PlantBase.Cast( targetObject );
52
53 if ( plant.IsGrowing() || plant.IsDry() || !plant.HasCrops() || plant.IsSpoiled())
54 {
55 return true;
56 }
57 }
58
59 return false;*/
60 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), and m_Plant.

◆ CreateConditionComponents()

override void ActionRemovePlant::CreateConditionComponents ( )
inlineprivate

Definition at line 15 of file ActionRemovePlant.c.

16 {
19 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float SMALL

References m_ConditionItem, m_ConditionTarget, and UAMaxDistances::SMALL.

◆ GetInputType()

override ActionRemovePlant::GetInputType ( )
inlineprivate

Definition at line 10 of file ActionRemovePlant.c.

◆ OnExecuteServer()

override void ActionRemovePlant::OnExecuteServer ( ActionData action_data)
inlineprivate

Definition at line 62 of file ActionRemovePlant.c.

63 {
64 if (m_Plant)
65 {
66 //m_Plant.RemovePlant();
67
68 //New method allowing us to pass player position
69 m_Plant.RemovePlantEx(action_data.m_Player.GetPosition());
70 }
71 /*Object targetObject = action_data.m_Target.GetObject();
72 if ( targetObject != NULL && targetObject.IsInherited(PlantBase) )
73 {
74 PlantBase plant = PlantBase.Cast( targetObject );
75 plant.RemovePlant();
76 }*/
77 }

References m_Plant.

Member Data Documentation

◆ m_Plant

PlantBase ActionRemovePlant::m_Plant
private

Definition at line 3 of file ActionRemovePlant.c.

Referenced by ActionCondition(), and OnExecuteServer().


The documentation for this class was generated from the following file: