Add art image properties to RFR

develop
Japa 2018-02-04 16:02:02 +05:30
parent 956d0ce363
commit 78061085c6
3 changed files with 101 additions and 2 deletions

@ -1 +1 @@
Subproject commit 392922a045f7965a0d75d16062452f37a7bcf7be
Subproject commit 40da7231a0114fe3420d475961b08826f64fbf79

@ -935,10 +935,25 @@ message ArtImageElement
optional int32 id = 6;
}
enum ArtImagePropertyType
{
TRANSITIVE_VERB = 0;
INTRANSITIVE_VERB = 1;
}
message ArtImageProperty
{
optional int32 subject = 1;
optional int32 object = 2;
optional ArtImageVerb verb = 3;
optional ArtImagePropertyType type = 4;
}
message ArtImage
{
repeated ArtImageElement elements = 1;
optional MatPair id = 2;
repeated ArtImageProperty properties = 3;
}
message Engraving
@ -957,4 +972,56 @@ message Engraving
optional bool northeast = 12;
optional bool southwest = 13;
optional bool southeast = 14;
}
}
enum ArtImageVerb
{
VERB_WITHERING = 0;
VERB_SURROUNDEDBY = 1;
VERB_MASSACRING = 2;
VERB_FIGHTING = 3;
VERB_LABORING = 4;
VERB_GREETING = 5;
VERB_REFUSING = 6;
VERB_SPEAKING = 7;
VERB_EMBRACING = 8;
VERB_STRIKINGDOWN = 9;
VERB_MENACINGPOSE = 10;
VERB_TRAVELING = 11;
VERB_RAISING = 12;
VERB_HIDING = 13;
VERB_LOOKINGCONFUSED = 14;
VERB_LOOKINGTERRIFIED = 15;
VERB_DEVOURING = 16;
VERB_ADMIRING = 17;
VERB_BURNING = 18;
VERB_WEEPING = 19;
VERB_LOOKINGDEJECTED = 20;
VERB_CRINGING = 21;
VERB_SCREAMING = 22;
VERB_SUBMISSIVEGESTURE = 23;
VERB_FETALPOSITION = 24;
VERB_SMEAREDINTOSPIRAL = 25;
VERB_FALLING = 26;
VERB_DEAD = 27;
VERB_LAUGHING = 28;
VERB_LOOKINGOFFENDED = 29;
VERB_BEINGSHOT = 30;
VERB_PLAINTIVEGESTURE = 31;
VERB_MELTING = 32;
VERB_SHOOTING = 33;
VERB_TORTURING = 34;
VERB_COMMITTINGDEPRAVEDACT = 35;
VERB_PRAYING = 36;
VERB_CONTEMPLATING = 37;
VERB_COOKING = 38;
VERB_ENGRAVING = 39;
VERB_PROSTRATING = 40;
VERB_SUFFERING = 41;
VERB_BEINGIMPALED = 42;
VERB_BEINGCONTORTED = 43;
VERB_BEINGFLAYED = 44;
VERB_HANGINGFROM = 45;
VERB_BEINGMUTILATED = 46;
VERB_TRIUMPHANTPOSE = 47;
}

@ -11,6 +11,9 @@
#include "df/art_image_element_shapest.h"
#include "df/art_image_element_treest.h"
#include "df/art_image_element_type.h"
#include "df/art_image_property.h"
#include "df/art_image_property_intransitive_verbst.h"
#include "df/art_image_property_transitive_verbst.h"
#include "df/art_image_ref.h"
#include "df/descriptor_shape.h"
#include "df/item_type.h"
@ -105,6 +108,35 @@ void CopyImage(const df::art_image * image, ArtImage * netImage)
break;
}
}
for (int i = 0; i < image->properties.size(); i++)
{
auto dfProperty = image->properties[i];
auto netProperty = netImage->add_properties();
auto propertyType = dfProperty->getType();
netProperty->set_type((ArtImagePropertyType)propertyType);
switch (propertyType)
{
case df::enums::art_image_property_type::transitive_verb:
{
VIRTUAL_CAST_VAR(transitive, df::art_image_property_transitive_verbst, dfProperty);
netProperty->set_subject(transitive->subject);
netProperty->set_object(transitive->object);
netProperty->set_verb((ArtImageVerb)transitive->verb);
break;
}
case df::enums::art_image_property_type::intransitive_verb:
{
VIRTUAL_CAST_VAR(intransitive, df::art_image_property_intransitive_verbst, dfProperty);
netProperty->set_subject(intransitive->subject);
netProperty->set_verb((ArtImageVerb)intransitive->verb);
break;
}
default:
break;
}
}
}
void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem)