25 static void InstantVote()
35 array<EVotingType> votingTypes = {};
36 array<int> votingValues = {};
38 int count = manager.GetAllVotingsWithValue(votingTypes, votingValues,
false,
true);
40 for (
int i = count - 1; i >= 0; i--)
42 if (manager.HasAbstainedLocally(votingTypes[i], votingValues[i]))
44 votingTypes.Remove(i);
45 votingValues.Remove(i);
49 if (manager.IsLocalVote(votingTypes[i], votingValues[i]))
51 votingTypes.Remove(i);
52 votingValues.Remove(i);
57 if (votingTypes.Count() == 1)
58 voterComponent.Vote(votingTypes[0], votingValues[0]);
65 static void InstantRemoveAndAbstainVote()
75 array<EVotingType> votingTypes = {};
76 array<int> votingValues = {};
78 int count = manager.GetAllVotingsWithValue(votingTypes, votingValues,
false,
true);
80 for (
int i = count - 1; i >= 0; i--)
82 if (manager.HasAbstainedLocally(votingTypes[i], votingValues[i]))
84 votingTypes.Remove(i);
85 votingValues.Remove(i);
89 if (manager.IsLocalVote(votingTypes[i], votingValues[i]))
91 votingTypes.Remove(i);
92 votingValues.Remove(i);
97 if (votingTypes.Count() == 1)
98 voterComponent.RemoveVote(votingTypes[0], votingValues[0]);
113 manager.VoteLocal(
type, value);
130 manager.RemoveVoteLocal(
type, value);
144 if (manager.IsLocalVote(
type, value))
147 manager.RemoveVoteLocal(
type, value);
150 manager.AbstainVoteLocally(
type, value);
162 return manager.IsLocalVote(
type, value);
176 return manager.HasAbstainedLocally(
type, value);
183 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
192 [
RplRpc(RplChannel.Reliable, RplRcver.Server)]
207 Debug.Error2(
"SCR_VoterComponent",
"SCR_VoterComponent must be attached to PlayerController!");