-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrelationship.cpp
32 lines (27 loc) · 1.21 KB
/
relationship.cpp
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
#include "relationship.h"
#include <vector>
#include <algorithm>
std::vector<RelationshipGroup> sceneDirectorRelationshipGroups= {
{ "ACTOR_GROUPA", "Group A", 0x5F0783F1 },
{ "ACTOR_GROUPB", "Group B", 0x5F0783F2 },
{ "ACTOR_GROUPC", "Group C", 0x5F0783F3 },
};
std::vector<RelationshipGroup> getAllRelationshipGroups(){
return sceneDirectorRelationshipGroups;
}
RelationshipGroup getDefaultRelationshipGroup() {
return sceneDirectorRelationshipGroups[0];
}
RelationshipGroup getNextRelationshipGroup(RelationshipGroup relationshipGroup) {
//int foundIndex = find(spotLightColors.begin(), spotLightColors.end(), spotLightColor) - spotLightColors.begin();
//see http://stackoverflow.com/questions/14225932/search-for-a-struct-item-in-a-vector-by-member-data
int foundIndex = std::find_if(sceneDirectorRelationshipGroups.begin(), sceneDirectorRelationshipGroups.end(), [=](RelationshipGroup const& group) {
return (group.actorHash == relationshipGroup.actorHash);
}) - sceneDirectorRelationshipGroups.begin();
if (foundIndex + 1 >= sceneDirectorRelationshipGroups.size()) {//color not found or in last element
return sceneDirectorRelationshipGroups[0];
}
else {
return sceneDirectorRelationshipGroups[foundIndex + 1];
}
}