Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseVariableSightsFOVInfo.c
Go to the documentation of this file.
2 {
3  //------------------------------------------------------------------------------------------------
7  int GetCount() { return 0; }
8 
9  //------------------------------------------------------------------------------------------------
13  int GetCurrentIndex() { return -1; }
14 
15  //------------------------------------------------------------------------------------------------
21  protected int GetNextIndex(bool allowOverflow = true)
22  {
23  int count = GetCount();
24  if (count < 1)
25  return -1;
26 
27  int current = GetCurrentIndex();
28  int next = current + 1;
29  if (next > count - 1)
30  {
31  if (allowOverflow)
32  return 0;
33  else
34  return -1;
35  }
36 
37  return next;
38  }
39 
40  //------------------------------------------------------------------------------------------------
46  protected int GetPreviousIndex(bool allowUnderflow = true)
47  {
48  int count = GetCount();
49  if (count < 1)
50  return -1;
51 
52  int current = GetCurrentIndex();
53  int previous = current - 1;
54  if (previous < 0)
55  {
56  if (allowUnderflow)
57  return count - 1;
58  else return -1;
59  }
60 
61  return previous;
62  }
63 
64  //------------------------------------------------------------------------------------------------
69  protected void SetIndex(int index);
70 
71  //------------------------------------------------------------------------------------------------
77  bool SetNext(bool allowOverflow = true)
78  {
79  int next = GetNextIndex(allowOverflow);
80  if (next != -1)
81  {
82  SetIndex(next);
83  return true;
84  }
85 
86  return false;
87  }
88 
89  //------------------------------------------------------------------------------------------------
95  bool SetPrevious(bool allowUnderflow = true)
96  {
97  int prev = GetPreviousIndex(allowUnderflow);
98  if (prev != -1)
99  {
100  SetIndex(prev);
101  return true;
102  }
103 
104  return false;
105  }
106 
107  //------------------------------------------------------------------------------------------------
109  bool IsAdjusting()
110  {
111  return false;
112  }
113 
114  //------------------------------------------------------------------------------------------------
116  float GetBaseFOV()
117  {
118  return GetCurrentFOV();
119  }
120 };
ScriptedSightsFOVInfo
Definition: ScriptedSightsFOVInfo.c:7
SCR_BaseVariableSightsFOVInfo
Definition: SCR_BaseVariableSightsFOVInfo.c:1
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17