summaryrefslogtreecommitdiff
path: root/library/proto
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-17 15:36:42 +0400
committerAlexander Gavrilov2012-03-17 15:36:42 +0400
commit15ccfbb08693a3c89c01a522cd3d2af59c13b051 (patch)
treeaf5e4ff318021dbc233f1954d8337b74b4d92fd1 /library/proto
parent58eb199036db3662ec2f7a2d6d301e7f432d5639 (diff)
downloaddfhack-15ccfbb08693a3c89c01a522cd3d2af59c13b051.tar.gz
dfhack-15ccfbb08693a3c89c01a522cd3d2af59c13b051.tar.bz2
dfhack-15ccfbb08693a3c89c01a522cd3d2af59c13b051.tar.xz
Add a ListMaterials remote call for bulk download of basic material info.
Diffstat (limited to 'library/proto')
-rw-r--r--library/proto/Basic.proto54
-rw-r--r--library/proto/BasicApi.proto17
2 files changed, 71 insertions, 0 deletions
diff --git a/library/proto/Basic.proto b/library/proto/Basic.proto
new file mode 100644
index 00000000..92a993b7
--- /dev/null
+++ b/library/proto/Basic.proto
@@ -0,0 +1,54 @@
+package dfproto;
+
+option optimize_for = LITE_RUNTIME;
+
+message BasicMaterialId {
+ required int32 type = 1;
+ required sint32 index = 2;
+};
+
+message BasicMaterialInfo {
+ required int32 type = 1;
+ required sint32 index = 2;
+
+ required string token = 3;
+ repeated string flags = 4;
+
+ optional int32 subtype = 5 [default = -1];
+ optional int32 creature_id = 6 [default = -1];
+ optional int32 plant_id = 7 [default = -1];
+ optional int32 hfig_id = 8 [default = -1];
+
+ optional string name_prefix = 9 [default = ""];
+
+ repeated fixed32 state_color = 10;
+ repeated string state_name = 11;
+ repeated string state_adj = 12;
+
+ message Product {
+ required string id = 1;
+ required int32 type = 2;
+ required sint32 index = 3;
+ };
+ repeated string reaction_class = 13;
+ repeated Product reaction_product = 14;
+
+ repeated string inorganic_flags = 15;
+};
+
+message BasicMaterialInfoMask {
+ enum StateType {
+ Solid = 0;
+ Liquid = 1;
+ Gas = 2;
+ Powder = 3;
+ Paste = 4;
+ Pressed = 5;
+ };
+ repeated StateType states = 1;
+
+ optional bool flags = 2 [default = false];
+ optional bool reaction = 3 [default = false];
+ optional int32 temperature = 4;
+};
+
diff --git a/library/proto/BasicApi.proto b/library/proto/BasicApi.proto
new file mode 100644
index 00000000..b5a56986
--- /dev/null
+++ b/library/proto/BasicApi.proto
@@ -0,0 +1,17 @@
+package dfproto;
+
+option optimize_for = LITE_RUNTIME;
+
+import "Basic.proto";
+
+message ListMaterialsRq {
+ optional BasicMaterialInfoMask mask = 1;
+ repeated BasicMaterialId id_list = 2;
+ optional bool builtin = 3;
+ optional bool inorganic = 4;
+ optional bool creatures = 5;
+ optional bool plants = 6;
+};
+message ListMaterialsRes {
+ repeated BasicMaterialInfo value = 1;
+};