Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
switchable_base.c
Go to the documentation of this file.
1 class Switchable_Base extends ItemBase
2 {
3  override void OnWasAttached( EntityAI parent, int slot_id )
4  {
5  super.OnWasAttached( parent, slot_id );
6 
7  ItemBase parent_item;
8  if ( Class.CastTo(parent_item,parent) )
9  {
10  parent_item.AddLightSourceItem(this);
11  }
12  }
13 
14  override void OnWasDetached( EntityAI parent, int slot_id )
15  {
16  super.OnWasDetached( parent, slot_id );
17 
18  ItemBase parent_item;
19  if ( Class.CastTo(parent_item,parent) )
20  {
21  parent_item.RemoveLightSourceItem();
22  }
23  }
24 
25  override void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
26  {
27  super.EEItemLocationChanged(oldLoc, newLoc);
28 
29  if (GetLight())
30  {
31  GetLight().UpdateMode();
32  }
33  }
34 }
ItemBase
Definition: inventoryitem.c:730
OnWasAttached
override void OnWasAttached(EntityAI parent, int slot_id)
Definition: torch.c:945
Switchable_Base
Definition: chainsaw.c:1
EEItemLocationChanged
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Definition: remotedetonator.c:72
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
OnWasDetached
override void OnWasDetached(EntityAI parent, int slot_id)
Definition: remotedetonator.c:237
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
EntityAI
Definition: building.c:5