Removed the unity client from the repo. It's been put to its own repository, and isn't really part of DFhack.

develop
JapaMala 2014-06-13 20:39:47 +05:30
parent e7010172e9
commit b600002fbc
114 changed files with 0 additions and 6855 deletions

@ -1,11 +0,0 @@
[Oo]bj
[Bb]in
*.user
*.suo
*.[Cc]ache
*.bak
*.ncb
*.log
*.DS_Store
[Tt]humbs.db
Ankh.NoLoad

@ -1,12 +0,0 @@
*.sln
*.userprefs
*.csproj
*.pidb
*.unityproj
.DS_Store
/Library/FailedAssetImports.txt
/Library/cache/
/Library/previews/
/Library/ScriptAssemblies
/obj
/Temp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

@ -1,36 +0,0 @@
fileFormatVersion: 2
guid: 89b0f8fea628a544a9855c108fbe35dc
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
userData:

@ -1,27 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bad
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 0, b: 0, a: 1}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 9fd804cbd377fd445805d7e5eea47877
NativeFormatImporter:
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: fd22bd16464e8784cbd88809cdc697a3
folderAsset: yes
DefaultImporter:
userData:

@ -1,356 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Generated from: isoworldremote.proto
namespace isoworldremote
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ColorDefinition")]
public partial class ColorDefinition : global::ProtoBuf.IExtensible
{
public ColorDefinition() {}
private int _red;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"red", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int red
{
get { return _red; }
set { _red = value; }
}
private int _green;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"green", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int green
{
get { return _green; }
set { _green = value; }
}
private int _blue;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"blue", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int blue
{
get { return _blue; }
set { _blue = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EmbarkTileLayer")]
public partial class EmbarkTileLayer : global::ProtoBuf.IExtensible
{
public EmbarkTileLayer() {}
private readonly global::System.Collections.Generic.List<isoworldremote.BasicMaterial> _mat_type_table = new global::System.Collections.Generic.List<isoworldremote.BasicMaterial>();
[global::ProtoBuf.ProtoMember(4, Name=@"mat_type_table", DataFormat = global::ProtoBuf.DataFormat.TwosComplement, Options = global::ProtoBuf.MemberSerializationOptions.Packed)]
public global::System.Collections.Generic.List<isoworldremote.BasicMaterial> mat_type_table
{
get { return _mat_type_table; }
}
private readonly global::System.Collections.Generic.List<int> _mat_subtype_table = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(5, Name=@"mat_subtype_table", DataFormat = global::ProtoBuf.DataFormat.TwosComplement, Options = global::ProtoBuf.MemberSerializationOptions.Packed)]
public global::System.Collections.Generic.List<int> mat_subtype_table
{
get { return _mat_subtype_table; }
}
private readonly global::System.Collections.Generic.List<isoworldremote.BasicShape> _tile_shape_table = new global::System.Collections.Generic.List<isoworldremote.BasicShape>();
[global::ProtoBuf.ProtoMember(6, Name=@"tile_shape_table", DataFormat = global::ProtoBuf.DataFormat.TwosComplement, Options = global::ProtoBuf.MemberSerializationOptions.Packed)]
public global::System.Collections.Generic.List<isoworldremote.BasicShape> tile_shape_table
{
get { return _tile_shape_table; }
}
private readonly global::System.Collections.Generic.List<isoworldremote.ColorDefinition> _tile_color_table = new global::System.Collections.Generic.List<isoworldremote.ColorDefinition>();
[global::ProtoBuf.ProtoMember(7, Name=@"tile_color_table", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<isoworldremote.ColorDefinition> tile_color_table
{
get { return _tile_color_table; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EmbarkTile")]
public partial class EmbarkTile : global::ProtoBuf.IExtensible
{
public EmbarkTile() {}
private int _world_x;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"world_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int world_x
{
get { return _world_x; }
set { _world_x = value; }
}
private int _world_y;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"world_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int world_y
{
get { return _world_y; }
set { _world_y = value; }
}
private int _world_z;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"world_z", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
public int world_z
{
get { return _world_z; }
set { _world_z = value; }
}
private readonly global::System.Collections.Generic.List<isoworldremote.EmbarkTileLayer> _tile_layer = new global::System.Collections.Generic.List<isoworldremote.EmbarkTileLayer>();
[global::ProtoBuf.ProtoMember(4, Name=@"tile_layer", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<isoworldremote.EmbarkTileLayer> tile_layer
{
get { return _tile_layer; }
}
private int _current_year = default(int);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"current_year", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int current_year
{
get { return _current_year; }
set { _current_year = value; }
}
private int _current_season = default(int);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"current_season", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int current_season
{
get { return _current_season; }
set { _current_season = value; }
}
private bool _is_valid = default(bool);
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"is_valid", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool is_valid
{
get { return _is_valid; }
set { _is_valid = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"TileRequest")]
public partial class TileRequest : global::ProtoBuf.IExtensible
{
public TileRequest() {}
private int _want_x = default(int);
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"want_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int want_x
{
get { return _want_x; }
set { _want_x = value; }
}
private int _want_y = default(int);
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"want_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int want_y
{
get { return _want_y; }
set { _want_y = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"MapRequest")]
public partial class MapRequest : global::ProtoBuf.IExtensible
{
public MapRequest() {}
private string _save_folder = "";
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"save_folder", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string save_folder
{
get { return _save_folder; }
set { _save_folder = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"MapReply")]
public partial class MapReply : global::ProtoBuf.IExtensible
{
public MapReply() {}
private bool _available;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"available", DataFormat = global::ProtoBuf.DataFormat.Default)]
public bool available
{
get { return _available; }
set { _available = value; }
}
private int _region_x = default(int);
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"region_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int region_x
{
get { return _region_x; }
set { _region_x = value; }
}
private int _region_y = default(int);
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"region_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int region_y
{
get { return _region_y; }
set { _region_y = value; }
}
private int _region_size_x = default(int);
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"region_size_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int region_size_x
{
get { return _region_size_x; }
set { _region_size_x = value; }
}
private int _region_size_y = default(int);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"region_size_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int region_size_y
{
get { return _region_size_y; }
set { _region_size_y = value; }
}
private int _current_year = default(int);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"current_year", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int current_year
{
get { return _current_year; }
set { _current_year = value; }
}
private int _current_season = default(int);
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"current_season", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int current_season
{
get { return _current_season; }
set { _current_season = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"RawNames")]
public partial class RawNames : global::ProtoBuf.IExtensible
{
public RawNames() {}
private bool _available;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"available", DataFormat = global::ProtoBuf.DataFormat.Default)]
public bool available
{
get { return _available; }
set { _available = value; }
}
private readonly global::System.Collections.Generic.List<string> _inorganic = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(2, Name=@"inorganic", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> inorganic
{
get { return _inorganic; }
}
private readonly global::System.Collections.Generic.List<string> _organic = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(3, Name=@"organic", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> organic
{
get { return _organic; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::ProtoBuf.ProtoContract(Name=@"BasicMaterial")]
public enum BasicMaterial
{
[global::ProtoBuf.ProtoEnum(Name=@"AIR", Value=0)]
AIR = 0,
[global::ProtoBuf.ProtoEnum(Name=@"OTHER", Value=1)]
OTHER = 1,
[global::ProtoBuf.ProtoEnum(Name=@"INORGANIC", Value=2)]
INORGANIC = 2,
[global::ProtoBuf.ProtoEnum(Name=@"LIQUID", Value=3)]
LIQUID = 3,
[global::ProtoBuf.ProtoEnum(Name=@"PLANT", Value=4)]
PLANT = 4,
[global::ProtoBuf.ProtoEnum(Name=@"WOOD", Value=5)]
WOOD = 5
}
[global::ProtoBuf.ProtoContract(Name=@"LiquidType")]
public enum LiquidType
{
[global::ProtoBuf.ProtoEnum(Name=@"ICE", Value=0)]
ICE = 0,
[global::ProtoBuf.ProtoEnum(Name=@"WATER", Value=1)]
WATER = 1,
[global::ProtoBuf.ProtoEnum(Name=@"MAGMA", Value=2)]
MAGMA = 2
}
[global::ProtoBuf.ProtoContract(Name=@"BasicShape")]
public enum BasicShape
{
[global::ProtoBuf.ProtoEnum(Name=@"NONE", Value=0)]
NONE = 0,
[global::ProtoBuf.ProtoEnum(Name=@"OPEN", Value=1)]
OPEN = 1,
[global::ProtoBuf.ProtoEnum(Name=@"WALL", Value=3)]
WALL = 3,
[global::ProtoBuf.ProtoEnum(Name=@"FLOOR", Value=4)]
FLOOR = 4,
[global::ProtoBuf.ProtoEnum(Name=@"RAMP_UP", Value=5)]
RAMP_UP = 5,
[global::ProtoBuf.ProtoEnum(Name=@"RAMP_DOWN", Value=6)]
RAMP_DOWN = 6
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 49176d7675a998345966feca21555311
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: f9efc5e870ab48243b2f508f00b7a740
folderAsset: yes
DefaultImporter:
userData:

@ -1,110 +0,0 @@
using isoworldremote;
using UnityEditor;
using UnityEngine;
using System;
[CustomEditor(typeof(MapBlock))]
[CanEditMultipleObjects]
public class MapBlockEditor : Editor
{
static Color32 selectedColor = Color.white;
static BasicShape selectedShape = BasicShape.WALL;
public override void OnInspectorGUI()
{
MapBlock[] targetBlocks = Array.ConvertAll(targets, element => (MapBlock)element);
if(targets.Length == 1)
EditorGUILayout.LabelField(targets.Length + " Map Block selected.");
else
EditorGUILayout.LabelField(targets.Length + " Map Blocks selected.");
selectedColor = EditorGUILayout.ColorField("Material Color", selectedColor);
selectedShape = (BasicShape)EditorGUILayout.EnumPopup("Terrain Shape ", selectedShape);
EditorGUILayout.BeginVertical();
DFHack.DFCoord2d tempCoord = new DFHack.DFCoord2d();
for (int i = 0; i < 16; i++)
{
EditorGUILayout.BeginHorizontal();
for (int j = 0; j < 16; j++)
{
tempCoord.x = j;
tempCoord.y = i;
Color currentColor = targetBlocks[0].GetColor(tempCoord);
for (int index = 1; index < targetBlocks.Length; index++)
{
if (currentColor != targetBlocks[index].GetColor(tempCoord))
{
currentColor = Color.white;
break;
}
}
currentColor.a = 1.0f;
GUI.color = currentColor;
string buttonIcon = "\u00A0";
BasicShape tile = targetBlocks[0].GetSingleTile(tempCoord);
for (int index = 1; index < targetBlocks.Length; index++)
{
if (tile != targetBlocks[index].GetSingleTile(tempCoord))
{
tile = BasicShape.NONE;
break;
}
}
switch (tile)
{
case BasicShape.WALL:
buttonIcon = "▓";
break;
case BasicShape.FLOOR:
buttonIcon = "+";
break;
case BasicShape.NONE:
buttonIcon = "?";
break;
case BasicShape.OPEN:
buttonIcon = "\u00A0";
break;
case BasicShape.RAMP_UP:
buttonIcon = "▲";
break;
case BasicShape.RAMP_DOWN:
buttonIcon = "▼";
break;
default:
buttonIcon = "?";
break;
}
if (GUILayout.Button(buttonIcon))
{
for (int index = 0; index < targetBlocks.Length; index++)
{
targetBlocks[index].SetSingleTile(tempCoord, selectedShape);
targetBlocks[index].SetColor(tempCoord, selectedColor);
targetBlocks[index].Regenerate();
EditorUtility.SetDirty(targetBlocks[index]);
}
}
}
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.EndVertical();
GUI.color = Color.white;
if (GUILayout.Button("Fill"))
{
for (int index = 0; index < targetBlocks.Length; index++)
{
for (int i = 0; i < 16; i++)
for (int j = 0; j < 16; j++)
{
DFHack.DFCoord2d here = new DFHack.DFCoord2d(j, i);
targetBlocks[index].SetSingleTile(here, selectedShape);
targetBlocks[index].SetColor(here, selectedColor);
}
targetBlocks[index].Regenerate();
EditorUtility.SetDirty(targetBlocks[index]);
}
}
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6e1305e96d61f204f8229e0a0cb7f8c1
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,57 +0,0 @@
using UnityEngine;
using System.Collections;
public class GameWindow : MonoBehaviour
{
public int viewPortWidth = 80;
public int viewPortHeight = 25;
public float verticalShift;
public float viewDistance = 5;
float n, f, r, l, t, b;
Matrix4x4 mat = new Matrix4x4();
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
float screenAspect = (float)Screen.width / (float)Screen.height;
float viewportAspect = (float)viewPortWidth / (float)viewPortHeight;
float fraction = screenAspect / viewportAspect;
float height = (viewPortHeight / 2.0f) / Mathf.Sin((camera.fieldOfView / 2) * Mathf.Deg2Rad);
transform.localPosition = new Vector3(0, height, -verticalShift);
camera.nearClipPlane = height - 1.0001f;
camera.farClipPlane = height + viewDistance;
RenderSettings.fogStartDistance = camera.nearClipPlane;
RenderSettings.fogEndDistance = camera.farClipPlane;
if (fraction > 1.0f) //If the screen is wider than the DF Viewport
{
camera.rect = new Rect(0.5f - ((1.0f / fraction) / 2.0f), 0.0f, 1.0f / fraction, 1.0f);
}
else //If the DF Viewport is wider.
{
camera.rect = new Rect(0.0f, 0.5f - (fraction / 2.0f), 1.0f, fraction);
}
//make a custom camera matrix, rather than use the inbuilt one.
n = camera.nearClipPlane;
f = camera.farClipPlane;
r = viewPortWidth / 2.0f;
l = -viewPortWidth / 2.0f;
t = verticalShift + (viewPortHeight / 2.0f);
b = verticalShift - (viewPortHeight / 2.0f);
mat[0, 0] = 2 * n / (r - l); mat[1, 0] = 0; mat[2, 0] = 0; mat[3, 0] = 0;
mat[0, 1] = 0; mat[1, 1] = 2 * n / (t - b); mat[2, 1] = 0; mat[3, 1] = 0;
mat[0, 2] = (r + l) / (r - l); mat[1, 2] = (t + b) / (t - b); mat[2, 2] = -(f + n) / (f - n); mat[3, 2] = -1;
mat[0, 3] = 0; mat[1, 3] = 0; mat[2, 3] = -2 * f * n / (f - n); ; mat[3, 3] = 0;
camera.projectionMatrix = mat;
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: b54fa8be8a38a9f4e8f53b4399135e30
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,79 +0,0 @@
using UnityEngine;
using System.Collections;
[AddComponentMenu("Utilities/HUDFPS")]
public class HUDFPS : MonoBehaviour
{
// Attach this to any object to make a frames/second indicator.
//
// It calculates frames/second over each updateInterval,
// so the display does not keep changing wildly.
//
// It is also fairly accurate at very low FPS counts (<10).
// We do this not by simply counting frames per interval, but
// by accumulating FPS for each frame. This way we end up with
// corstartRect overall FPS even if the interval renders something like
// 5.5 frames.
public Rect startRect = new Rect(10, 10, 75, 50); // The rect the window is initially displayed at.
public bool updateColor = true; // Do you want the color to change if the FPS gets low
public bool allowDrag = true; // Do you want to allow the dragging of the FPS window
public float frequency = 0.5F; // The update frequency of the fps
public int nbDecimal = 1; // How many decimal do you want to display
private float accum = 0f; // FPS accumulated over the interval
private int frames = 0; // Frames drawn over the interval
private Color color = Color.white; // The color of the GUI, depending of the FPS ( R < 10, Y < 30, G >= 30 )
private string sFPS = ""; // The fps formatted into a string.
private GUIStyle style; // The style the text will be displayed at, based en defaultSkin.label.
void Start()
{
StartCoroutine(FPS());
}
void Update()
{
accum += Time.timeScale / Time.deltaTime;
++frames;
}
IEnumerator FPS()
{
// Infinite loop executed every "frenquency" secondes.
while (true)
{
// Update the FPS
float fps = accum / frames;
sFPS = fps.ToString("f" + Mathf.Clamp(nbDecimal, 0, 10));
//Update the color
color = (fps >= 30) ? Color.green : ((fps > 10) ? Color.red : Color.yellow);
accum = 0.0F;
frames = 0;
yield return new WaitForSeconds(frequency);
}
}
void OnGUI()
{
// Copy the default label skin, change the color and the alignement
if (style == null)
{
style = new GUIStyle(GUI.skin.label);
style.normal.textColor = Color.white;
style.alignment = TextAnchor.MiddleCenter;
}
GUI.color = updateColor ? color : Color.white;
startRect = GUI.Window(0, startRect, DoMyWindow, "");
}
void DoMyWindow(int windowID)
{
GUI.Label(new Rect(0, 0, startRect.width, startRect.height), sFPS + " FPS", style);
if (allowDrag) GUI.DragWindow(new Rect(0, 0, Screen.width, Screen.height));
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 2fb12edbd5d56cb4c99ccf773df52492
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: c7e34aa4b4a41d1478337506ce720e18
folderAsset: yes
DefaultImporter:
userData:

@ -1,15 +0,0 @@
using UnityEngine;
using System.Collections;
public class GameMap : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: aa92a0e1eefe93b40bec1e868142e050
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,321 +0,0 @@
using DFHack;
using System.Collections.Generic;
using UnityEngine;
using isoworldremote;
public class MapBlock : MonoBehaviour
{
public static float floorHeight = 0.1f;
public static float rampDistance = 2.0f;
DFCoord coordinates;
GameMap parent;
[SerializeField]
BasicShape[] terrain = new BasicShape[256];
[SerializeField]
Color32[] colors = new Color32[256];
List<Vector3> finalVertices = new List<Vector3>();
List<int> finalFaces = new List<int>();
List<Color32> finalVertexColors = new List<Color32>();
List<Vector2> finalUVs = new List<Vector2>();
public enum Openness
{
air,
mixed,
stone
}
Openness openness;
public void SetOpenness()
{
int air = 0;
int solid = 0;
for (int x = 0; x < 16; x++)
for (int y = 0; y < 16; y++)
{
if (terrain[y * 16 + x] == BasicShape.OPEN || terrain[y * 16 + x] == BasicShape.NONE)
air++;
else if (terrain[y * 16 + x] == BasicShape.WALL)
solid++;
}
if (air == 256)
openness = Openness.air;
else if (solid == 256)
openness = Openness.stone;
else openness = Openness.mixed;
}
public Openness GetOpenness()
{
return openness;
}
public Color32 GetColor(DFCoord2d position)
{
return colors[position.x + position.y * 16];
}
public void SetColor(DFCoord2d position, Color32 input)
{
colors[position.x + position.y * 16] = input;
}
public void SetSingleTile(DFCoord2d position, BasicShape tile)
{
terrain[position.x + position.y * 16] = tile;
SetOpenness();
}
public BasicShape GetSingleTile(DFCoord2d position)
{
if (position.x >= 0 && position.x < 16 && position.y >= 0 && position.y < 16)
return terrain[position.x + position.y * 16];
else
return BasicShape.NONE;
}
public void Regenerate()
{
finalVertices.Clear();
finalFaces.Clear();
finalVertexColors.Clear();
finalUVs.Clear();
if (openness == Openness.air)
{
}
else
{
for (int i = 0; i < 16; i++)
for (int j = 0; j < 16; j++)
{
DFCoord2d here = new DFCoord2d(i, j);
switch (GetSingleTile(here))
{
case BasicShape.WALL:
AddTopFace(here, 1.0f);
break;
case BasicShape.FLOOR:
AddTopFace(here, floorHeight);
break;
}
AddSideFace(here, FaceDirection.North);
AddSideFace(here, FaceDirection.South);
AddSideFace(here, FaceDirection.East);
AddSideFace(here, FaceDirection.West);
}
}
MeshFilter mf = GetComponent<MeshFilter>();
Mesh mesh = new Mesh();
mf.mesh = mesh;
mesh.vertices = finalVertices.ToArray();
mesh.uv = finalUVs.ToArray();
mesh.colors32 = finalVertexColors.ToArray();
mesh.triangles = finalFaces.ToArray();
mesh.RecalculateBounds();
mesh.RecalculateNormals();
}
enum FaceDirection
{
Up,
Down,
North,
South,
East,
West
}
BasicShape GetRelativeTile(DFCoord2d position, FaceDirection direction)
{
DFCoord2d relativePosition = new DFCoord2d(position.x, position.y);
switch (direction)
{
case FaceDirection.North:
relativePosition.y--;
break;
case FaceDirection.South:
relativePosition.y++;
break;
case FaceDirection.East:
relativePosition.x++;
break;
case FaceDirection.West:
relativePosition.x--;
break;
}
return GetSingleTile(relativePosition);
}
enum Layer
{
Base,
Floor,
Top
}
float convertDistanceToOffset(float input)
{
if (input == float.MaxValue)
return 0;
input = Mathf.Pow(input, 0.5f);
input = (rampDistance - input) / rampDistance;
if (input < 0)
return 0;
return Mathf.Sin(input * Mathf.PI / 4.0f);
}
Vector3 AdjustForRamps(Vector3 input, Layer layer = Layer.Floor)
{
float nearestUpRamp = float.MaxValue;
float nearestDownRamp = float.MaxValue;
for (int x = (int)(input.x - rampDistance); x < (int)(input.x + rampDistance + 1.0f); x++)
for (int y = (int)(-input.z - rampDistance); y < (int)(-input.z + rampDistance + 1.0f); y++)
{
BasicShape tile = GetSingleTile(new DFCoord2d(x, y));
if(tile == BasicShape.RAMP_UP || tile == BasicShape.RAMP_DOWN)
{
float tempDistance = Mathf.Pow(input.x - x, 2) + Mathf.Pow(-input.z - y, 2);
if (tile == BasicShape.RAMP_DOWN && tempDistance < nearestDownRamp)
nearestDownRamp = tempDistance;
if (tile == BasicShape.RAMP_UP && tempDistance < nearestUpRamp)
nearestUpRamp = tempDistance;
}
}
nearestUpRamp = convertDistanceToOffset(nearestUpRamp);
nearestDownRamp = convertDistanceToOffset(nearestDownRamp);
if (layer == Layer.Floor)
input.y = input.y + nearestUpRamp - nearestDownRamp;
if (layer == Layer.Top)
input.y = input.y - nearestUpRamp;
return input;
}
void AddSideFace(DFCoord2d position, FaceDirection direction)
{
Layer topLayer = Layer.Top;
Layer bottomLayer = Layer.Base;
float currentFloorHeight = -0.5f;
float adjacentFloorHeight = -0.5f;
switch (GetSingleTile(position))
{
case BasicShape.WALL:
currentFloorHeight = 0.5f;
topLayer = Layer.Top;
break;
case BasicShape.FLOOR:
currentFloorHeight = floorHeight - 0.5f;
topLayer = Layer.Floor;
break;
default:
break;
}
switch (GetRelativeTile(position, direction))
{
case BasicShape.WALL:
adjacentFloorHeight = 0.5f;
bottomLayer = Layer.Top;
break;
case BasicShape.FLOOR:
adjacentFloorHeight = floorHeight - 0.5f;
bottomLayer = Layer.Floor;
break;
default:
break;
}
if (currentFloorHeight <= adjacentFloorHeight)
return;
int startindex = finalVertices.Count;
int uvPos = 0;
switch (direction)
{
case FaceDirection.North:
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, currentFloorHeight, -(position.y - 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, currentFloorHeight, -(position.y - 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, adjacentFloorHeight, -(position.y - 0.5f)), bottomLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, adjacentFloorHeight, -(position.y - 0.5f)), bottomLayer));
uvPos = position.x;
break;
case FaceDirection.South:
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, currentFloorHeight, -(position.y + 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, currentFloorHeight, -(position.y + 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, adjacentFloorHeight, -(position.y + 0.5f)), bottomLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, adjacentFloorHeight, -(position.y + 0.5f)), bottomLayer));
uvPos = 16 - position.x;
break;
case FaceDirection.East:
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, currentFloorHeight, -(position.y + 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, currentFloorHeight, -(position.y - 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, adjacentFloorHeight, -(position.y + 0.5f)), bottomLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, adjacentFloorHeight, -(position.y - 0.5f)), bottomLayer));
uvPos = position.y;
break;
case FaceDirection.West:
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, currentFloorHeight, -(position.y - 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, currentFloorHeight, -(position.y + 0.5f)), topLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, adjacentFloorHeight, -(position.y - 0.5f)), bottomLayer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, adjacentFloorHeight, -(position.y + 0.5f)), bottomLayer));
uvPos = 16 - position.y;
break;
default:
break;
}
finalUVs.Add(new Vector2(-(float)(uvPos + 1) / 16.0f, -(float)(0) / 16.0f));
finalUVs.Add(new Vector2(-(float)(uvPos) / 16.0f, -(float)(0) / 16.0f));
finalUVs.Add(new Vector2(-(float)(uvPos + 1) / 16.0f, -(float)(0 + 1) / 16.0f));
finalUVs.Add(new Vector2(-(float)(uvPos) / 16.0f, -(float)(0 + 1) / 16.0f));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalFaces.Add(startindex);
finalFaces.Add(startindex + 1);
finalFaces.Add(startindex + 2);
finalFaces.Add(startindex + 1);
finalFaces.Add(startindex + 3);
finalFaces.Add(startindex + 2);
}
void AddTopFace(DFCoord2d position, float height)
{
Layer layer = Layer.Base;
if (GetSingleTile(position) == BasicShape.FLOOR)
layer = Layer.Floor;
else if (GetSingleTile(position) == BasicShape.WALL)
layer = Layer.Top;
height -= 0.5f;
//Todo: Weld vertices that should be welded
//On second though, not with vertex colors there.
int startindex = finalVertices.Count;
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, height, -(position.y - 0.5f)), layer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, height, -(position.y - 0.5f)), layer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x - 0.5f, height, -(position.y + 0.5f)), layer));
finalVertices.Add(AdjustForRamps(new Vector3(position.x + 0.5f, height, -(position.y + 0.5f)), layer));
finalUVs.Add(new Vector2((float)(position.x) / 16.0f, -(float)(position.y) / 16.0f));
finalUVs.Add(new Vector2((float)(position.x + 1) / 16.0f, -(float)(position.y) / 16.0f));
finalUVs.Add(new Vector2((float)(position.x) / 16.0f, -(float)(position.y + 1) / 16.0f));
finalUVs.Add(new Vector2((float)(position.x + 1) / 16.0f, -(float)(position.y + 1) / 16.0f));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalVertexColors.Add(GetColor(position));
finalFaces.Add(startindex);
finalFaces.Add(startindex + 1);
finalFaces.Add(startindex + 2);
finalFaces.Add(startindex + 1);
finalFaces.Add(startindex + 3);
finalFaces.Add(startindex + 2);
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8d11b6dacbf85e24ead2e95cafce40fd
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: e4195866782d0214cb59abbae44f068f
folderAsset: yes
DefaultImporter:
userData:

@ -1,968 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Generated from: Basic.proto
namespace dfproto
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EnumItemName")]
public partial class EnumItemName : global::ProtoBuf.IExtensible
{
public EnumItemName() {}
private int _value;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int value
{
get { return _value; }
set { _value = value; }
}
private string _name = "";
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string name
{
get { return _name; }
set { _name = value; }
}
private int _bit_size = (int)1;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"bit_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)1)]
public int bit_size
{
get { return _bit_size; }
set { _bit_size = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialId")]
public partial class BasicMaterialId : global::ProtoBuf.IExtensible
{
public BasicMaterialId() {}
private int _type;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int type
{
get { return _type; }
set { _type = value; }
}
private int _index;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
public int index
{
get { return _index; }
set { _index = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialInfo")]
public partial class BasicMaterialInfo : global::ProtoBuf.IExtensible
{
public BasicMaterialInfo() {}
private int _type;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int type
{
get { return _type; }
set { _type = value; }
}
private int _index;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
public int index
{
get { return _index; }
set { _index = value; }
}
private string _token;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"token", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string token
{
get { return _token; }
set { _token = value; }
}
private readonly global::System.Collections.Generic.List<int> _flags = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(4, Name=@"flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> flags
{
get { return _flags; }
}
private int _subtype = (int)-1;
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"subtype", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int subtype
{
get { return _subtype; }
set { _subtype = value; }
}
private int _creature_id = (int)-1;
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"creature_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int creature_id
{
get { return _creature_id; }
set { _creature_id = value; }
}
private int _plant_id = (int)-1;
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"plant_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int plant_id
{
get { return _plant_id; }
set { _plant_id = value; }
}
private int _histfig_id = (int)-1;
[global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int histfig_id
{
get { return _histfig_id; }
set { _histfig_id = value; }
}
private string _name_prefix = "";
[global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"name_prefix", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string name_prefix
{
get { return _name_prefix; }
set { _name_prefix = value; }
}
private readonly global::System.Collections.Generic.List<uint> _state_color = new global::System.Collections.Generic.List<uint>();
[global::ProtoBuf.ProtoMember(10, Name=@"state_color", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public global::System.Collections.Generic.List<uint> state_color
{
get { return _state_color; }
}
private readonly global::System.Collections.Generic.List<string> _state_name = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(11, Name=@"state_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> state_name
{
get { return _state_name; }
}
private readonly global::System.Collections.Generic.List<string> _state_adj = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(12, Name=@"state_adj", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> state_adj
{
get { return _state_adj; }
}
private readonly global::System.Collections.Generic.List<string> _reaction_class = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(13, Name=@"reaction_class", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> reaction_class
{
get { return _reaction_class; }
}
private readonly global::System.Collections.Generic.List<dfproto.BasicMaterialInfo.Product> _reaction_product = new global::System.Collections.Generic.List<dfproto.BasicMaterialInfo.Product>();
[global::ProtoBuf.ProtoMember(14, Name=@"reaction_product", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.BasicMaterialInfo.Product> reaction_product
{
get { return _reaction_product; }
}
private readonly global::System.Collections.Generic.List<int> _inorganic_flags = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(15, Name=@"inorganic_flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> inorganic_flags
{
get { return _inorganic_flags; }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Product")]
public partial class Product : global::ProtoBuf.IExtensible
{
public Product() {}
private string _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string id
{
get { return _id; }
set { _id = value; }
}
private int _type;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int type
{
get { return _type; }
set { _type = value; }
}
private int _index;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"index", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
public int index
{
get { return _index; }
set { _index = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicMaterialInfoMask")]
public partial class BasicMaterialInfoMask : global::ProtoBuf.IExtensible
{
public BasicMaterialInfoMask() {}
private readonly global::System.Collections.Generic.List<dfproto.BasicMaterialInfoMask.StateType> _states = new global::System.Collections.Generic.List<dfproto.BasicMaterialInfoMask.StateType>();
[global::ProtoBuf.ProtoMember(1, Name=@"states", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<dfproto.BasicMaterialInfoMask.StateType> states
{
get { return _states; }
}
private int _temperature = (int)10015;
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"temperature", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)10015)]
public int temperature
{
get { return _temperature; }
set { _temperature = value; }
}
private bool _flags = (bool)false;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool flags
{
get { return _flags; }
set { _flags = value; }
}
private bool _reaction = (bool)false;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"reaction", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool reaction
{
get { return _reaction; }
set { _reaction = value; }
}
[global::ProtoBuf.ProtoContract(Name=@"StateType")]
public enum StateType
{
[global::ProtoBuf.ProtoEnum(Name=@"Solid", Value=0)]
Solid = 0,
[global::ProtoBuf.ProtoEnum(Name=@"Liquid", Value=1)]
Liquid = 1,
[global::ProtoBuf.ProtoEnum(Name=@"Gas", Value=2)]
Gas = 2,
[global::ProtoBuf.ProtoEnum(Name=@"Powder", Value=3)]
Powder = 3,
[global::ProtoBuf.ProtoEnum(Name=@"Paste", Value=4)]
Paste = 4,
[global::ProtoBuf.ProtoEnum(Name=@"Pressed", Value=5)]
Pressed = 5
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"JobSkillAttr")]
public partial class JobSkillAttr : global::ProtoBuf.IExtensible
{
public JobSkillAttr() {}
private int _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int id
{
get { return _id; }
set { _id = value; }
}
private string _key;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string key
{
get { return _key; }
set { _key = value; }
}
private string _caption = "";
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string caption
{
get { return _caption; }
set { _caption = value; }
}
private string _caption_noun = "";
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"caption_noun", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string caption_noun
{
get { return _caption_noun; }
set { _caption_noun = value; }
}
private int _profession = default(int);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int profession
{
get { return _profession; }
set { _profession = value; }
}
private int _labor = default(int);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int labor
{
get { return _labor; }
set { _labor = value; }
}
private string _type = "";
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string type
{
get { return _type; }
set { _type = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ProfessionAttr")]
public partial class ProfessionAttr : global::ProtoBuf.IExtensible
{
public ProfessionAttr() {}
private int _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int id
{
get { return _id; }
set { _id = value; }
}
private string _key;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string key
{
get { return _key; }
set { _key = value; }
}
private string _caption = "";
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string caption
{
get { return _caption; }
set { _caption = value; }
}
private bool _military = default(bool);
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"military", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool military
{
get { return _military; }
set { _military = value; }
}
private bool _can_assign_labor = default(bool);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"can_assign_labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool can_assign_labor
{
get { return _can_assign_labor; }
set { _can_assign_labor = value; }
}
private int _parent = default(int);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"parent", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int parent
{
get { return _parent; }
set { _parent = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitLaborAttr")]
public partial class UnitLaborAttr : global::ProtoBuf.IExtensible
{
public UnitLaborAttr() {}
private int _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int id
{
get { return _id; }
set { _id = value; }
}
private string _key;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string key
{
get { return _key; }
set { _key = value; }
}
private string _caption = "";
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"caption", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string caption
{
get { return _caption; }
set { _caption = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NameInfo")]
public partial class NameInfo : global::ProtoBuf.IExtensible
{
public NameInfo() {}
private string _first_name = "";
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"first_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string first_name
{
get { return _first_name; }
set { _first_name = value; }
}
private string _nickname = "";
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"nickname", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string nickname
{
get { return _nickname; }
set { _nickname = value; }
}
private int _language_id = (int)-1;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"language_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int language_id
{
get { return _language_id; }
set { _language_id = value; }
}
private string _last_name = "";
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"last_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string last_name
{
get { return _last_name; }
set { _last_name = value; }
}
private string _english_name = "";
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"english_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string english_name
{
get { return _english_name; }
set { _english_name = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"NameTriple")]
public partial class NameTriple : global::ProtoBuf.IExtensible
{
public NameTriple() {}
private string _normal;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"normal", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string normal
{
get { return _normal; }
set { _normal = value; }
}
private string _plural = "";
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"plural", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string plural
{
get { return _plural; }
set { _plural = value; }
}
private string _adjective = "";
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"adjective", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string adjective
{
get { return _adjective; }
set { _adjective = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitCurseInfo")]
public partial class UnitCurseInfo : global::ProtoBuf.IExtensible
{
public UnitCurseInfo() {}
private uint _add_tags1;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"add_tags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint add_tags1
{
get { return _add_tags1; }
set { _add_tags1 = value; }
}
private uint _rem_tags1;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"rem_tags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint rem_tags1
{
get { return _rem_tags1; }
set { _rem_tags1 = value; }
}
private uint _add_tags2;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"add_tags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint add_tags2
{
get { return _add_tags2; }
set { _add_tags2 = value; }
}
private uint _rem_tags2;
[global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"rem_tags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint rem_tags2
{
get { return _rem_tags2; }
set { _rem_tags2 = value; }
}
private dfproto.NameTriple _name = null;
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.NameTriple name
{
get { return _name; }
set { _name = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SkillInfo")]
public partial class SkillInfo : global::ProtoBuf.IExtensible
{
public SkillInfo() {}
private int _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int id
{
get { return _id; }
set { _id = value; }
}
private int _level;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"level", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int level
{
get { return _level; }
set { _level = value; }
}
private int _experience;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"experience", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int experience
{
get { return _experience; }
set { _experience = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitMiscTrait")]
public partial class UnitMiscTrait : global::ProtoBuf.IExtensible
{
public UnitMiscTrait() {}
private int _id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int id
{
get { return _id; }
set { _id = value; }
}
private int _value;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int value
{
get { return _value; }
set { _value = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicUnitInfo")]
public partial class BasicUnitInfo : global::ProtoBuf.IExtensible
{
public BasicUnitInfo() {}
private int _unit_id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int unit_id
{
get { return _unit_id; }
set { _unit_id = value; }
}
private int _pos_x;
[global::ProtoBuf.ProtoMember(13, IsRequired = true, Name=@"pos_x", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int pos_x
{
get { return _pos_x; }
set { _pos_x = value; }
}
private int _pos_y;
[global::ProtoBuf.ProtoMember(14, IsRequired = true, Name=@"pos_y", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int pos_y
{
get { return _pos_y; }
set { _pos_y = value; }
}
private int _pos_z;
[global::ProtoBuf.ProtoMember(15, IsRequired = true, Name=@"pos_z", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int pos_z
{
get { return _pos_z; }
set { _pos_z = value; }
}
private dfproto.NameInfo _name = null;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.NameInfo name
{
get { return _name; }
set { _name = value; }
}
private uint _flags1;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"flags1", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint flags1
{
get { return _flags1; }
set { _flags1 = value; }
}
private uint _flags2;
[global::ProtoBuf.ProtoMember(4, IsRequired = true, Name=@"flags2", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint flags2
{
get { return _flags2; }
set { _flags2 = value; }
}
private uint _flags3;
[global::ProtoBuf.ProtoMember(5, IsRequired = true, Name=@"flags3", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public uint flags3
{
get { return _flags3; }
set { _flags3 = value; }
}
private int _race;
[global::ProtoBuf.ProtoMember(6, IsRequired = true, Name=@"race", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int race
{
get { return _race; }
set { _race = value; }
}
private int _caste;
[global::ProtoBuf.ProtoMember(7, IsRequired = true, Name=@"caste", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int caste
{
get { return _caste; }
set { _caste = value; }
}
private int _gender = (int)-1;
[global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"gender", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int gender
{
get { return _gender; }
set { _gender = value; }
}
private int _civ_id = (int)-1;
[global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int civ_id
{
get { return _civ_id; }
set { _civ_id = value; }
}
private int _histfig_id = (int)-1;
[global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int histfig_id
{
get { return _histfig_id; }
set { _histfig_id = value; }
}
private int _death_id = (int)-1;
[global::ProtoBuf.ProtoMember(17, IsRequired = false, Name=@"death_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int death_id
{
get { return _death_id; }
set { _death_id = value; }
}
private uint _death_flags = default(uint);
[global::ProtoBuf.ProtoMember(18, IsRequired = false, Name=@"death_flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(uint))]
public uint death_flags
{
get { return _death_flags; }
set { _death_flags = value; }
}
private int _squad_id = (int)-1;
[global::ProtoBuf.ProtoMember(19, IsRequired = false, Name=@"squad_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int squad_id
{
get { return _squad_id; }
set { _squad_id = value; }
}
private int _squad_position = (int)-1;
[global::ProtoBuf.ProtoMember(20, IsRequired = false, Name=@"squad_position", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int squad_position
{
get { return _squad_position; }
set { _squad_position = value; }
}
private int _profession = (int)-1;
[global::ProtoBuf.ProtoMember(22, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)-1)]
public int profession
{
get { return _profession; }
set { _profession = value; }
}
private string _custom_profession = "";
[global::ProtoBuf.ProtoMember(23, IsRequired = false, Name=@"custom_profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string custom_profession
{
get { return _custom_profession; }
set { _custom_profession = value; }
}
private readonly global::System.Collections.Generic.List<int> _labors = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(11, Name=@"labors", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> labors
{
get { return _labors; }
}
private readonly global::System.Collections.Generic.List<dfproto.SkillInfo> _skills = new global::System.Collections.Generic.List<dfproto.SkillInfo>();
[global::ProtoBuf.ProtoMember(12, Name=@"skills", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.SkillInfo> skills
{
get { return _skills; }
}
private readonly global::System.Collections.Generic.List<dfproto.UnitMiscTrait> _misc_traits = new global::System.Collections.Generic.List<dfproto.UnitMiscTrait>();
[global::ProtoBuf.ProtoMember(24, Name=@"misc_traits", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.UnitMiscTrait> misc_traits
{
get { return _misc_traits; }
}
private dfproto.UnitCurseInfo _curse = null;
[global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"curse", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.UnitCurseInfo curse
{
get { return _curse; }
set { _curse = value; }
}
private readonly global::System.Collections.Generic.List<int> _burrows = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(21, Name=@"burrows", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> burrows
{
get { return _burrows; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicUnitInfoMask")]
public partial class BasicUnitInfoMask : global::ProtoBuf.IExtensible
{
public BasicUnitInfoMask() {}
private bool _labors = (bool)false;
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"labors", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool labors
{
get { return _labors; }
set { _labors = value; }
}
private bool _skills = (bool)false;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"skills", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool skills
{
get { return _skills; }
set { _skills = value; }
}
private bool _profession = (bool)false;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool profession
{
get { return _profession; }
set { _profession = value; }
}
private bool _misc_traits = (bool)false;
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"misc_traits", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue((bool)false)]
public bool misc_traits
{
get { return _misc_traits; }
set { _misc_traits = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"BasicSquadInfo")]
public partial class BasicSquadInfo : global::ProtoBuf.IExtensible
{
public BasicSquadInfo() {}
private int _squad_id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"squad_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int squad_id
{
get { return _squad_id; }
set { _squad_id = value; }
}
private dfproto.NameInfo _name = null;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.NameInfo name
{
get { return _name; }
set { _name = value; }
}
private string _alias = "";
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"alias", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string alias
{
get { return _alias; }
set { _alias = value; }
}
private readonly global::System.Collections.Generic.List<int> _members = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(4, Name=@"members", DataFormat = global::ProtoBuf.DataFormat.ZigZag)]
public global::System.Collections.Generic.List<int> members
{
get { return _members; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"UnitLaborState")]
public partial class UnitLaborState : global::ProtoBuf.IExtensible
{
public UnitLaborState() {}
private int _unit_id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int unit_id
{
get { return _unit_id; }
set { _unit_id = value; }
}
private int _labor;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int labor
{
get { return _labor; }
set { _labor = value; }
}
private bool _value;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public bool value
{
get { return _value; }
set { _value = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 2678d7ad7ff72d248854d487d8f15c21
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,460 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Generated from: BasicApi.proto
// Note: requires additional types generated from: Basic.proto
namespace dfproto
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetWorldInfoOut")]
public partial class GetWorldInfoOut : global::ProtoBuf.IExtensible
{
public GetWorldInfoOut() {}
private dfproto.GetWorldInfoOut.Mode _mode;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"mode", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public dfproto.GetWorldInfoOut.Mode mode
{
get { return _mode; }
set { _mode = value; }
}
private string _save_dir;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"save_dir", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string save_dir
{
get { return _save_dir; }
set { _save_dir = value; }
}
private dfproto.NameInfo _world_name = null;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"world_name", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.NameInfo world_name
{
get { return _world_name; }
set { _world_name = value; }
}
private int _civ_id = default(int);
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int civ_id
{
get { return _civ_id; }
set { _civ_id = value; }
}
private int _site_id = default(int);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"site_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int site_id
{
get { return _site_id; }
set { _site_id = value; }
}
private int _group_id = default(int);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"group_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int group_id
{
get { return _group_id; }
set { _group_id = value; }
}
private int _race_id = default(int);
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"race_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int race_id
{
get { return _race_id; }
set { _race_id = value; }
}
private int _player_unit_id = default(int);
[global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"player_unit_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int player_unit_id
{
get { return _player_unit_id; }
set { _player_unit_id = value; }
}
private int _player_histfig_id = default(int);
[global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"player_histfig_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int player_histfig_id
{
get { return _player_histfig_id; }
set { _player_histfig_id = value; }
}
private readonly global::System.Collections.Generic.List<int> _companion_histfig_ids = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(10, Name=@"companion_histfig_ids", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> companion_histfig_ids
{
get { return _companion_histfig_ids; }
}
[global::ProtoBuf.ProtoContract(Name=@"Mode")]
public enum Mode
{
[global::ProtoBuf.ProtoEnum(Name=@"MODE_DWARF", Value=1)]
MODE_DWARF = 1,
[global::ProtoBuf.ProtoEnum(Name=@"MODE_ADVENTURE", Value=2)]
MODE_ADVENTURE = 2,
[global::ProtoBuf.ProtoEnum(Name=@"MODE_LEGENDS", Value=3)]
MODE_LEGENDS = 3
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListEnumsOut")]
public partial class ListEnumsOut : global::ProtoBuf.IExtensible
{
public ListEnumsOut() {}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _material_flags = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(1, Name=@"material_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> material_flags
{
get { return _material_flags; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _inorganic_flags = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(2, Name=@"inorganic_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> inorganic_flags
{
get { return _inorganic_flags; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _unit_flags1 = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(3, Name=@"unit_flags1", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> unit_flags1
{
get { return _unit_flags1; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _unit_flags2 = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(4, Name=@"unit_flags2", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> unit_flags2
{
get { return _unit_flags2; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _unit_flags3 = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(5, Name=@"unit_flags3", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> unit_flags3
{
get { return _unit_flags3; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _unit_labor = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(6, Name=@"unit_labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> unit_labor
{
get { return _unit_labor; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _job_skill = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(7, Name=@"job_skill", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> job_skill
{
get { return _job_skill; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _cie_add_tag_mask1 = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(8, Name=@"cie_add_tag_mask1", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> cie_add_tag_mask1
{
get { return _cie_add_tag_mask1; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _cie_add_tag_mask2 = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(9, Name=@"cie_add_tag_mask2", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> cie_add_tag_mask2
{
get { return _cie_add_tag_mask2; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _death_info_flags = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(10, Name=@"death_info_flags", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> death_info_flags
{
get { return _death_info_flags; }
}
private readonly global::System.Collections.Generic.List<dfproto.EnumItemName> _profession = new global::System.Collections.Generic.List<dfproto.EnumItemName>();
[global::ProtoBuf.ProtoMember(11, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.EnumItemName> profession
{
get { return _profession; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListJobSkillsOut")]
public partial class ListJobSkillsOut : global::ProtoBuf.IExtensible
{
public ListJobSkillsOut() {}
private readonly global::System.Collections.Generic.List<dfproto.JobSkillAttr> _skill = new global::System.Collections.Generic.List<dfproto.JobSkillAttr>();
[global::ProtoBuf.ProtoMember(1, Name=@"skill", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.JobSkillAttr> skill
{
get { return _skill; }
}
private readonly global::System.Collections.Generic.List<dfproto.ProfessionAttr> _profession = new global::System.Collections.Generic.List<dfproto.ProfessionAttr>();
[global::ProtoBuf.ProtoMember(2, Name=@"profession", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.ProfessionAttr> profession
{
get { return _profession; }
}
private readonly global::System.Collections.Generic.List<dfproto.UnitLaborAttr> _labor = new global::System.Collections.Generic.List<dfproto.UnitLaborAttr>();
[global::ProtoBuf.ProtoMember(3, Name=@"labor", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.UnitLaborAttr> labor
{
get { return _labor; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListMaterialsIn")]
public partial class ListMaterialsIn : global::ProtoBuf.IExtensible
{
public ListMaterialsIn() {}
private dfproto.BasicMaterialInfoMask _mask = null;
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"mask", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.BasicMaterialInfoMask mask
{
get { return _mask; }
set { _mask = value; }
}
private readonly global::System.Collections.Generic.List<dfproto.BasicMaterialId> _id_list = new global::System.Collections.Generic.List<dfproto.BasicMaterialId>();
[global::ProtoBuf.ProtoMember(2, Name=@"id_list", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.BasicMaterialId> id_list
{
get { return _id_list; }
}
private bool _builtin = default(bool);
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"builtin", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool builtin
{
get { return _builtin; }
set { _builtin = value; }
}
private bool _inorganic = default(bool);
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"inorganic", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool inorganic
{
get { return _inorganic; }
set { _inorganic = value; }
}
private bool _creatures = default(bool);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"creatures", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool creatures
{
get { return _creatures; }
set { _creatures = value; }
}
private bool _plants = default(bool);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"plants", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool plants
{
get { return _plants; }
set { _plants = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListMaterialsOut")]
public partial class ListMaterialsOut : global::ProtoBuf.IExtensible
{
public ListMaterialsOut() {}
private readonly global::System.Collections.Generic.List<dfproto.BasicMaterialInfo> _value = new global::System.Collections.Generic.List<dfproto.BasicMaterialInfo>();
[global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.BasicMaterialInfo> value
{
get { return _value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListUnitsIn")]
public partial class ListUnitsIn : global::ProtoBuf.IExtensible
{
public ListUnitsIn() {}
private dfproto.BasicUnitInfoMask _mask = null;
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"mask", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public dfproto.BasicUnitInfoMask mask
{
get { return _mask; }
set { _mask = value; }
}
private readonly global::System.Collections.Generic.List<int> _id_list = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(2, Name=@"id_list", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> id_list
{
get { return _id_list; }
}
private bool _scan_all = default(bool);
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"scan_all", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool scan_all
{
get { return _scan_all; }
set { _scan_all = value; }
}
private int _race = default(int);
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"race", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int race
{
get { return _race; }
set { _race = value; }
}
private int _civ_id = default(int);
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"civ_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(default(int))]
public int civ_id
{
get { return _civ_id; }
set { _civ_id = value; }
}
private bool _dead = default(bool);
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"dead", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool dead
{
get { return _dead; }
set { _dead = value; }
}
private bool _alive = default(bool);
[global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"alive", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool alive
{
get { return _alive; }
set { _alive = value; }
}
private bool _sane = default(bool);
[global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"sane", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(default(bool))]
public bool sane
{
get { return _sane; }
set { _sane = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListUnitsOut")]
public partial class ListUnitsOut : global::ProtoBuf.IExtensible
{
public ListUnitsOut() {}
private readonly global::System.Collections.Generic.List<dfproto.BasicUnitInfo> _value = new global::System.Collections.Generic.List<dfproto.BasicUnitInfo>();
[global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.BasicUnitInfo> value
{
get { return _value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListSquadsIn")]
public partial class ListSquadsIn : global::ProtoBuf.IExtensible
{
public ListSquadsIn() {}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ListSquadsOut")]
public partial class ListSquadsOut : global::ProtoBuf.IExtensible
{
public ListSquadsOut() {}
private readonly global::System.Collections.Generic.List<dfproto.BasicSquadInfo> _value = new global::System.Collections.Generic.List<dfproto.BasicSquadInfo>();
[global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.BasicSquadInfo> value
{
get { return _value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"SetUnitLaborsIn")]
public partial class SetUnitLaborsIn : global::ProtoBuf.IExtensible
{
public SetUnitLaborsIn() {}
private readonly global::System.Collections.Generic.List<dfproto.UnitLaborState> _change = new global::System.Collections.Generic.List<dfproto.UnitLaborState>();
[global::ProtoBuf.ProtoMember(1, Name=@"change", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.UnitLaborState> change
{
get { return _change; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: ab257b5c0c7259943a5b614e3dde558e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,119 +0,0 @@
using System;
using UnityEngine;
using AT.MIN;
using dfproto;
namespace DFHack
{
public enum color_value
{
COLOR_RESET = -1,
COLOR_BLACK = 0,
COLOR_BLUE,
COLOR_GREEN,
COLOR_CYAN,
COLOR_RED,
COLOR_MAGENTA,
COLOR_BROWN,
COLOR_GREY,
COLOR_DARKGREY,
COLOR_LIGHTBLUE,
COLOR_LIGHTGREEN,
COLOR_LIGHTCYAN,
COLOR_LIGHTRED,
COLOR_LIGHTMAGENTA,
COLOR_YELLOW,
COLOR_WHITE,
COLOR_MAX = COLOR_WHITE
};
public class color_ostream
{
string buffer;
public void printerr(string Format, params object[] Parameters)
{
Debug.LogError(Tools.sprintf(Format, Parameters));
}
public void print(string Format, params object[] Parameters)
{
Debug.Log(Tools.sprintf(Format, Parameters));
}
public void begin_batch()
{
buffer = "";
}
public void end_batch()
{
Debug.Log(buffer);
buffer = null;
}
public void add_text(color_value color, string text)
{
//Debug.Log(text);
buffer += text;
}
}
public class buffered_color_ostream : color_ostream
{
//protected:
public new void add_text(color_value color, string text)
{
if (text.Length == 0)
return;
if (buffer.Length == 0)
{
buffer = text;
}
else
{
buffer += text;
}
}
// buffered_color_ostream() {}
// ~buffered_color_ostream() {}
// const std::list<fragment_type> &fragments() { return buffer; }
protected string buffer;
}
public class color_ostream_proxy : buffered_color_ostream
{
protected color_ostream target;
//virtual void flush_proxy();
public color_ostream_proxy(color_ostream targetIn)
{
target = targetIn;
}
public virtual color_ostream proxy_target() { return target; }
public void decode(dfproto.CoreTextNotification data)
{
int cnt = data.fragments.Count;
if (cnt > 0)
{
target.begin_batch();
for (int i = 0; i < cnt; i++)
{
var frag = data.fragments[i];
//color_value color = frag.has_color() ? color_value(frag.color()) : COLOR_RESET;
target.add_text(color_value.COLOR_RESET, frag.text);
//target.printerr(data.fragments[i].text);
}
target.end_batch();
}
}
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8401f7b1211481b469ac746534a896b8
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,311 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// Generated from: CoreProtocol.proto
namespace dfproto
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreTextFragment")]
public partial class CoreTextFragment : global::ProtoBuf.IExtensible
{
public CoreTextFragment() {}
private string _text;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"text", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string text
{
get { return _text; }
set { _text = value; }
}
private dfproto.CoreTextFragment.Color _color = dfproto.CoreTextFragment.Color.COLOR_BLACK;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"color", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(dfproto.CoreTextFragment.Color.COLOR_BLACK)]
public dfproto.CoreTextFragment.Color color
{
get { return _color; }
set { _color = value; }
}
[global::ProtoBuf.ProtoContract(Name=@"Color")]
public enum Color
{
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_BLACK", Value=0)]
COLOR_BLACK = 0,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_BLUE", Value=1)]
COLOR_BLUE = 1,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_GREEN", Value=2)]
COLOR_GREEN = 2,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_CYAN", Value=3)]
COLOR_CYAN = 3,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_RED", Value=4)]
COLOR_RED = 4,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_MAGENTA", Value=5)]
COLOR_MAGENTA = 5,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_BROWN", Value=6)]
COLOR_BROWN = 6,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_GREY", Value=7)]
COLOR_GREY = 7,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_DARKGREY", Value=8)]
COLOR_DARKGREY = 8,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTBLUE", Value=9)]
COLOR_LIGHTBLUE = 9,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTGREEN", Value=10)]
COLOR_LIGHTGREEN = 10,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTCYAN", Value=11)]
COLOR_LIGHTCYAN = 11,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTRED", Value=12)]
COLOR_LIGHTRED = 12,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_LIGHTMAGENTA", Value=13)]
COLOR_LIGHTMAGENTA = 13,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_YELLOW", Value=14)]
COLOR_YELLOW = 14,
[global::ProtoBuf.ProtoEnum(Name=@"COLOR_WHITE", Value=15)]
COLOR_WHITE = 15
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreTextNotification")]
public partial class CoreTextNotification : global::ProtoBuf.IExtensible
{
public CoreTextNotification() {}
private readonly global::System.Collections.Generic.List<dfproto.CoreTextFragment> _fragments = new global::System.Collections.Generic.List<dfproto.CoreTextFragment>();
[global::ProtoBuf.ProtoMember(1, Name=@"fragments", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<dfproto.CoreTextFragment> fragments
{
get { return _fragments; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreErrorNotification")]
public partial class CoreErrorNotification : global::ProtoBuf.IExtensible
{
public CoreErrorNotification() {}
private dfproto.CoreErrorNotification.ErrorCode _code;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"code", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public dfproto.CoreErrorNotification.ErrorCode code
{
get { return _code; }
set { _code = value; }
}
[global::ProtoBuf.ProtoContract(Name=@"ErrorCode")]
public enum ErrorCode
{
[global::ProtoBuf.ProtoEnum(Name=@"CR_LINK_FAILURE", Value=-3)]
CR_LINK_FAILURE = -3,
[global::ProtoBuf.ProtoEnum(Name=@"CR_WOULD_BREAK", Value=-2)]
CR_WOULD_BREAK = -2,
[global::ProtoBuf.ProtoEnum(Name=@"CR_NOT_IMPLEMENTED", Value=-1)]
CR_NOT_IMPLEMENTED = -1,
[global::ProtoBuf.ProtoEnum(Name=@"CR_OK", Value=0)]
CR_OK = 0,
[global::ProtoBuf.ProtoEnum(Name=@"CR_FAILURE", Value=1)]
CR_FAILURE = 1,
[global::ProtoBuf.ProtoEnum(Name=@"CR_WRONG_USAGE", Value=2)]
CR_WRONG_USAGE = 2,
[global::ProtoBuf.ProtoEnum(Name=@"CR_NOT_FOUND", Value=3)]
CR_NOT_FOUND = 3
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"EmptyMessage")]
public partial class EmptyMessage : global::ProtoBuf.IExtensible
{
public EmptyMessage() {}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"IntMessage")]
public partial class IntMessage : global::ProtoBuf.IExtensible
{
public IntMessage() {}
private int _value;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int value
{
get { return _value; }
set { _value = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"IntListMessage")]
public partial class IntListMessage : global::ProtoBuf.IExtensible
{
public IntListMessage() {}
private readonly global::System.Collections.Generic.List<int> _value = new global::System.Collections.Generic.List<int>();
[global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public global::System.Collections.Generic.List<int> value
{
get { return _value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StringMessage")]
public partial class StringMessage : global::ProtoBuf.IExtensible
{
public StringMessage() {}
private string _value;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string value
{
get { return _value; }
set { _value = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"StringListMessage")]
public partial class StringListMessage : global::ProtoBuf.IExtensible
{
public StringListMessage() {}
private readonly global::System.Collections.Generic.List<string> _value = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(1, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> value
{
get { return _value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreBindRequest")]
public partial class CoreBindRequest : global::ProtoBuf.IExtensible
{
public CoreBindRequest() {}
private string _method;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"method", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string method
{
get { return _method; }
set { _method = value; }
}
private string _input_msg;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"input_msg", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string input_msg
{
get { return _input_msg; }
set { _input_msg = value; }
}
private string _output_msg;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"output_msg", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string output_msg
{
get { return _output_msg; }
set { _output_msg = value; }
}
private string _plugin = "";
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"plugin", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string plugin
{
get { return _plugin; }
set { _plugin = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreBindReply")]
public partial class CoreBindReply : global::ProtoBuf.IExtensible
{
public CoreBindReply() {}
private int _assigned_id;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"assigned_id", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public int assigned_id
{
get { return _assigned_id; }
set { _assigned_id = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CoreRunCommandRequest")]
public partial class CoreRunCommandRequest : global::ProtoBuf.IExtensible
{
public CoreRunCommandRequest() {}
private string _command;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"command", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string command
{
get { return _command; }
set { _command = value; }
}
private readonly global::System.Collections.Generic.List<string> _arguments = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(2, Name=@"arguments", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> arguments
{
get { return _arguments; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d8595cea157337845be980bcc8978623
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,849 +0,0 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2012 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
using dfproto;
using System;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections.Generic;
using System.Diagnostics;
namespace DFHack
{
using message_type = ProtoBuf.IExtensible;
public enum command_result
{
CR_LINK_FAILURE = -3, // RPC call failed due to I/O or protocol error
CR_NEEDS_CONSOLE = -2, // Attempt to call interactive command without console
CR_NOT_IMPLEMENTED = -1, // Command not implemented, or plugin not loaded
CR_OK = 0, // Success
CR_FAILURE = 1, // Failure
CR_WRONG_USAGE = 2, // Wrong arguments or ui state
CR_NOT_FOUND = 3 // Target object not found (for RPC mainly)
}
public enum DFHackReplyCode
{
RPC_REPLY_RESULT = -1,
RPC_REPLY_FAIL = -2,
RPC_REPLY_TEXT = -3,
RPC_REQUEST_QUIT = -4
}
class RPCHandshakeHeader
{
//public string magic;
//public int version;
public static string REQUEST_MAGIC = "DFHack?\n";
public static string RESPONSE_MAGIC = "DFHack!\n";
}
struct RPCMessageHeader
{
public const int MAX_MESSAGE_SIZE = 8 * 1048576;
public Int16 id;
public Int32 size;
public byte[] ConvertToBtyes()
{
List<byte> output = new List<byte>();
output.AddRange(BitConverter.GetBytes(id));
output.AddRange(new byte[2]);
output.AddRange(BitConverter.GetBytes(size));
return output.ToArray();
}
string BytesToString(byte[] input)
{
string output = "";
foreach (byte item in input)
{
if (output.Length > 0)
output += ",";
output += item;
}
return output;
}
}
// simple function to store
struct DFCoord
{
public int x, y, z;
//convert
UnityEngine.Vector3 ToVector3()
{
return new UnityEngine.Vector3(x + 0.5f, z + 0.5f, -y - 0.5f);
}
static DFCoord FromVector3(UnityEngine.Vector3 input)
{
DFCoord output = new DFCoord((int)input.x, (int)(-input.z), (int)input.y);
return output;
}
DFCoord(int inx, int iny, int inz)
{
x = inx;
y = iny;
z = inz;
}
public bool isValid()
{
return x != -30000;
}
public void clear()
{
x = y = z = -30000;
}
public static bool operator <(DFCoord a, DFCoord b)
{
if (a.x != b.x) return (a.x < b.x);
if (a.y != b.y) return (a.y < b.y);
return a.z < b.z;
}
public static bool operator >(DFCoord a, DFCoord b)
{
if (a.x != b.x) return (a.x > b.x);
if (a.y != b.y) return (a.y > b.y);
return a.z > b.z;
}
public static DFCoord operator +(DFCoord a, DFCoord b)
{
return new DFCoord(a.x + b.x, a.y + b.y, a.z + b.z);
}
public static DFCoord operator -(DFCoord a, DFCoord b)
{
return new DFCoord(a.x - b.x, a.y - b.y, a.z - b.z);
}
public static DFCoord operator /(DFCoord a, int number)
{
return new DFCoord((a.x < 0 ? a.x - number : a.x) / number, (a.y < 0 ? a.y - number : a.y) / number, a.z);
}
public static DFCoord operator *(DFCoord a, int number)
{
return new DFCoord(a.x * number, a.y * number, a.z);
}
public static DFCoord operator %(DFCoord a, int number)
{
return new DFCoord((a.x + number) % number, (a.y + number) % number, a.z);
}
public static DFCoord operator -(DFCoord a, int number)
{
return new DFCoord(a.x, a.y, a.z - number);
}
public static DFCoord operator +(DFCoord a, int number)
{
return new DFCoord(a.x, a.y, a.z + number);
}
}
public struct DFCoord2d
{
public int x;
public int y;
public DFCoord2d(int _x, int _y)
{
x = _x;
y = _y;
}
public bool isValid()
{
return x != -30000;
}
public void clear()
{
x = y = -30000;
}
public static bool operator <(DFCoord2d a, DFCoord2d b)
{
if (a.x != b.x) return (a.x < b.x);
return a.y < b.y;
}
public static bool operator >(DFCoord2d a, DFCoord2d b)
{
if (a.x != b.x) return (a.x > b.x);
return a.y > b.y;
}
public static DFCoord2d operator +(DFCoord2d a, DFCoord2d b)
{
return new DFCoord2d(a.x + b.x, a.y + b.y);
}
public static DFCoord2d operator -(DFCoord2d a, DFCoord2d b)
{
return new DFCoord2d(a.x - b.x, a.y - b.y);
}
public static DFCoord2d operator /(DFCoord2d a, int number)
{
return new DFCoord2d((a.x < 0 ? a.x - number : a.x) / number, (a.y < 0 ? a.y - number : a.y) / number);
}
public static DFCoord2d operator *(DFCoord2d a, int number)
{
return new DFCoord2d(a.x * number, a.y * number);
}
public static DFCoord2d operator %(DFCoord2d a, int number)
{
return new DFCoord2d((a.x + number) % number, (a.y + number) % number);
}
public static DFCoord2d operator &(DFCoord2d a, int number)
{
return new DFCoord2d(a.x & number, a.y & number);
}
}
/* Protocol description:
*
* 1. Handshake
*
* Client initiates connection by sending the handshake
* request header. The server responds with the response
* magic. Currently both versions must be 1.
*
* 2. Interaction
*
* Requests are done by exchanging messages between the
* client and the server. Messages consist of a serialized
* protobuf message preceeded by RPCMessageHeader. The size
* field specifies the length of the protobuf part.
*
* NOTE: As a special exception, RPC_REPLY_FAIL uses the size
* field to hold the error code directly.
*
* Every callable function is assigned a non-negative id by
* the server. Id 0 is reserved for BindMethod, which can be
* used to request any other id by function name. Id 1 is
* RunCommand, used to call console commands remotely.
*
* The client initiates every call by sending a message with
* appropriate function id and input arguments. The server
* responds with zero or more RPC_REPLY_TEXT:CoreTextNotification
* messages, followed by RPC_REPLY_RESULT containing the output
* of the function if it succeeded, or RPC_REPLY_FAIL with the
* error code if it did not.
*
* 3. Disconnect
*
* The client terminates the connection by sending an
* RPC_REQUEST_QUIT header with zero size and immediately
* closing the socket.
*/
public class RPCFunctionBase
{
public message_type p_in_template;
public message_type p_out_template;
public message_type make_in()
{
return (message_type)Activator.CreateInstance(p_in_template.GetType());
}
public message_type input()
{
if (p_in == null) p_in = make_in();
return p_in;
}
public message_type make_out()
{
return (message_type)Activator.CreateInstance(p_out_template.GetType());
}
public message_type output()
{
if (p_out == null) p_out = make_out();
return p_out;
}
public void reset(bool free = false)
{
if (free)
{
p_in = null;
p_out = null;
}
else
{
if (p_in != null)
p_in = (message_type)Activator.CreateInstance(p_in.GetType());
if (p_out != null)
p_out = (message_type)Activator.CreateInstance(p_out.GetType());
}
}
public RPCFunctionBase(message_type input, message_type output)
{
p_in_template = input;
p_out_template = output;
p_in = null;
p_out = null;
}
~RPCFunctionBase()
{
p_in = null;
p_out = null;
}
message_type p_in;
message_type p_out;
}
public class RemoteFunctionBase : RPCFunctionBase
{
public bool bind(RemoteClient client, string name,
string proto = "")
{
return bind(client.default_output(), client, name, proto);
}
public bool bind(color_ostream output,
RemoteClient client, string name,
string proto = "")
{
if (isValid())
{
if (p_client == client && this.name == name && this.proto == proto)
return true;
output.printerr("Function already bound to %s::%s\n",
this.proto, this.name);
return false;
}
this.name = name;
this.proto = proto;
this.p_client = client;
return client.bind(output, this, name, proto);
}
public bool isValid() { return (id >= 0); }
public RemoteFunctionBase(message_type input, message_type output)
: base(input, output)
{
p_client = null;
id = -1;
}
protected color_ostream default_ostream()
{
return p_client.default_output();
}
bool sendRemoteMessage(Socket socket, Int16 id, MemoryStream msg)
{
List<byte> buffer = new List<byte>();
RPCMessageHeader header = new RPCMessageHeader();
header.id = id;
header.size = (Int32)msg.Length;
buffer.AddRange(header.ConvertToBtyes());
buffer.AddRange(msg.ToArray());
int fullsz = buffer.Count;
int got = socket.Send(buffer.ToArray());
return (got == fullsz);
}
protected command_result execute<Input, Output>(color_ostream outString, Input input, Output output)
where Input : message_type, new()
where Output : message_type, new()
{
if (!isValid())
{
outString.printerr("Calling an unbound RPC function %s::%s.\n",
this.proto, this.name);
return command_result.CR_NOT_IMPLEMENTED;
}
if (p_client.socket == null)
{
outString.printerr("In call to %s::%s: invalid socket.\n",
this.proto, this.name);
return command_result.CR_LINK_FAILURE;
}
MemoryStream sendStream = new MemoryStream();
ProtoBuf.Serializer.Serialize<Input>(sendStream, input);
long send_size = sendStream.Length;
if (send_size > RPCMessageHeader.MAX_MESSAGE_SIZE)
{
outString.printerr("In call to %s::%s: message too large: %d.\n",
this.proto, this.name, send_size);
return command_result.CR_LINK_FAILURE;
}
if (!sendRemoteMessage(p_client.socket, id, sendStream))
{
outString.printerr("In call to %s::%s: I/O error in send.\n",
this.proto, this.name);
return command_result.CR_LINK_FAILURE;
}
color_ostream_proxy text_decoder = new color_ostream_proxy(outString);
CoreTextNotification text_data;
output = new Output();
//return command_result.CR_OK;
while (true)
{
RPCMessageHeader header = new RPCMessageHeader();
byte[] buffer = new byte[8];
if (!RemoteClient.readFullBuffer(p_client.socket, buffer, 8))
{
outString.printerr("In call to %s::%s: I/O error in receive header.\n",
this.proto, this.name);
return command_result.CR_LINK_FAILURE;
}
header.id = BitConverter.ToInt16(buffer, 0);
header.size = BitConverter.ToInt32(buffer, 4); //because something, somewhere, is fucking retarded
//outString.print("Received %d:%d.\n", header.id, header.size);
if ((DFHackReplyCode)header.id == DFHackReplyCode.RPC_REPLY_FAIL)
if (header.size == (int)command_result.CR_OK)
return command_result.CR_FAILURE;
else
return (command_result)header.size;
if (header.size < 0 || header.size > RPCMessageHeader.MAX_MESSAGE_SIZE)
{
outString.printerr("In call to %s::%s: invalid received size %d.\n",
this.proto, this.name, header.size);
return command_result.CR_LINK_FAILURE;
}
byte[] buf = new byte[header.size];
if (!RemoteClient.readFullBuffer(p_client.socket, buf, header.size))
{
outString.printerr("In call to %s::%s: I/O error in receive %d bytes of data.\n",
this.proto, this.name, header.size);
return command_result.CR_LINK_FAILURE;
}
switch ((DFHackReplyCode)header.id)
{
case DFHackReplyCode.RPC_REPLY_RESULT:
output = ProtoBuf.Serializer.Deserialize<Output>(new MemoryStream(buf));
if (output == null)
{
outString.printerr("In call to %s::%s: error parsing received result.\n",
this.proto, this.name);
return command_result.CR_LINK_FAILURE;
}
return command_result.CR_OK;
case DFHackReplyCode.RPC_REPLY_TEXT:
text_data = ProtoBuf.Serializer.Deserialize<CoreTextNotification>(new MemoryStream(buf));
if (text_data != null)
{
text_decoder.decode(text_data);
}
else
outString.printerr("In call to %s::%s: received invalid text data.\n",
this.proto, this.name);
break;
default:
break;
}
}
}
public string name, proto;
public RemoteClient p_client;
public Int16 id;
}
public class RemoteFunction<Input, Output> : RemoteFunctionBase
where Input : message_type, new()
where Output : message_type, new()
{
public new Input make_in() { return (Input)(base.make_in()); }
public new Input input() { return (Input)(base.input()); }
public new Output make_out() { return (Output)(base.make_out()); }
public new Output output() { return (Output)(base.output()); }
public RemoteFunction() : base(new Input(), new Output()) { }
public command_result execute()
{
if (p_client == null)
return command_result.CR_NOT_IMPLEMENTED;
else
return base.execute<Input, Output>(default_ostream(), input(), output());
}
public command_result execute(color_ostream stream)
{
return base.execute<Input, Output>(stream, input(), output());
}
public command_result execute(Input input, Output output)
{
if (p_client == null)
return command_result.CR_NOT_IMPLEMENTED;
else
return base.execute<Input, Output>(default_ostream(), input, output);
}
public command_result execute(color_ostream stream, Input input, Output output)
{
return base.execute<Input, Output>(stream, input, output);
}
}
public class RemoteFunction<Input> : RemoteFunctionBase
where Input : message_type, new()
{
public new Input make_in() { return (Input)(base.make_in()); }
public new Input input() { return (Input)(base.input()); }
public RemoteFunction() : base(new Input(), new EmptyMessage()) { }
public command_result execute()
{
if (p_client == null)
return command_result.CR_NOT_IMPLEMENTED;
else
return base.execute<Input, EmptyMessage>(default_ostream(), input(), (EmptyMessage)output());
}
public command_result execute(color_ostream stream)
{
return base.execute<Input, EmptyMessage>(stream, input(), (EmptyMessage)output());
}
public command_result execute(Input input)
{
if (p_client == null)
return command_result.CR_NOT_IMPLEMENTED;
else
return base.execute<Input, EmptyMessage>(default_ostream(), input, (EmptyMessage)output());
}
public command_result execute(color_ostream stream, Input input)
{
return base.execute<Input, EmptyMessage>(stream, input, (EmptyMessage)output());
}
};
public class RemoteClient
{
public static bool readFullBuffer(Socket socket, byte[] buf, int size)
{
if (!socket.Connected)
return false;
if (size == 0)
return true;
int cnt = socket.Receive(buf, size, SocketFlags.None);
if (cnt <= 0) return false;
return true;
}
public bool bind(color_ostream outStream, RemoteFunctionBase function,
string name, string proto)
{
if (!active || socket == null)
return false;
bind_call.reset();
{
var input = bind_call.input();
input.method = name;
if (proto.Length == 0)
input.plugin = proto;
input.input_msg = function.p_in_template.GetType().ToString();
input.output_msg = function.p_out_template.GetType().ToString();
}
if (bind_call.execute(outStream) != command_result.CR_OK)
return false;
function.id = (Int16)bind_call.output().assigned_id;
return true;
}
public RemoteClient(color_ostream default_output = null)
{
p_default_output = default_output;
active = false;
socket = null;
suspend_ready = false;
if (p_default_output == null)
{
delete_output = true;
p_default_output = new color_ostream();
}
else
delete_output = false;
}
~RemoteClient()
{
disconnect();
socket = null;
if (delete_output)
p_default_output = null;
}
public static int GetDefaultPort()
{
string port = System.Environment.GetEnvironmentVariable("DFHACK_PORT");
if (port == null) port = "0";
int portval = Int32.Parse(port);
if (portval <= 0)
return 5000;
else
return portval;
}
public color_ostream default_output()
{
return p_default_output;
}
private static Socket ConnectSocket(string server, int port)
{
Socket s = null;
IPHostEntry hostEntry = null;
// Get host related information.
hostEntry = Dns.GetHostEntry(server);
// Loop through the AddressList to obtain the supported AddressFamily. This is to avoid
// an exception that occurs when the host IP Address is not compatible with the address family
// (typical in the IPv6 case).
foreach (IPAddress address in hostEntry.AddressList)
{
IPEndPoint ipe = new IPEndPoint(address, port);
Socket tempSocket =
new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
tempSocket.Connect(ipe);
if (tempSocket.Connected)
{
s = tempSocket;
break;
}
else
{
continue;
}
}
return s;
}
static bool partialArrayCompare(byte[] A, byte[] B) //compares the intersection of the two arrays, ignoring the rest.
{
int size = A.Length;
if (size > B.Length) size = B.Length;
for (int i = 0; i < size; i++)
{
if (A[i] != B[i])
return false;
}
return true;
}
public bool connect(int port = -1)
{
Debug.Assert(!active);
if (port <= 0)
port = GetDefaultPort();
socket = ConnectSocket("localhost", port);
if (socket == null)
{
default_output().printerr("Could not connect to localhost: %d\n", port);
return false;
}
active = true;
List<byte> headerList = new List<byte>();
headerList.AddRange(Encoding.ASCII.GetBytes(RPCHandshakeHeader.REQUEST_MAGIC));
headerList.AddRange(BitConverter.GetBytes((Int32)1));
byte[] header = headerList.ToArray();
if (socket.Send(header) != header.Length)
{
default_output().printerr("Could not send handshake header.\n");
socket.Close();
socket = null;
return active = false;
}
if (!readFullBuffer(socket, header, header.Length))
{
default_output().printerr("Could not read handshake header.\n");
socket.Close();
socket = null;
return active = false;
}
if (!partialArrayCompare(header, Encoding.ASCII.GetBytes(RPCHandshakeHeader.RESPONSE_MAGIC)) ||
BitConverter.ToInt32(header, Encoding.ASCII.GetBytes(RPCHandshakeHeader.RESPONSE_MAGIC).Length) != 1)
{
default_output().printerr("Invalid handshake response: %s.\n", System.Text.Encoding.Default.GetString(header));
socket.Close();
socket = null;
return active = false;
}
if (bind_call == null) bind_call = new RemoteFunction<CoreBindRequest, CoreBindReply>();
bind_call.name = "BindMethod";
bind_call.p_client = this;
bind_call.id = 0;
if (runcmd_call == null) runcmd_call = new RemoteFunction<CoreRunCommandRequest>();
runcmd_call.name = "RunCommand";
runcmd_call.p_client = this;
runcmd_call.id = 1;
return true;
}
public void disconnect()
{
if (active && socket != null)
{
RPCMessageHeader header;
header.id = (Int16)DFHackReplyCode.RPC_REQUEST_QUIT;
header.size = 0;
if (socket.Send(header.ConvertToBtyes()) != header.ConvertToBtyes().Length)
default_output().printerr("Could not send the disconnect message.\n");
socket.Close();
}
socket = null;
}
public command_result run_command(string cmd, List<string> args)
{
return run_command(default_output(), cmd, args);
}
public command_result run_command(color_ostream output, string cmd, List<string> args)
{
if (!active || socket == null)
{
output.printerr("In RunCommand: client connection not valid.\n");
return command_result.CR_FAILURE;
}
runcmd_call.reset();
runcmd_call.input().command = cmd;
for (int i = 0; i < args.Count; i++)
runcmd_call.input().arguments.Add(args[i]);
return runcmd_call.execute(output);
}
// // For executing multiple calls in rapid succession.
// // Best used via RemoteSuspender.
public int suspend_game()
{
if (!active)
return -1;
if (!suspend_ready)
{
suspend_ready = true;
suspend_call.bind(this, "CoreSuspend");
resume_call.bind(this, "CoreResume");
}
if (suspend_call.execute(default_output()) == command_result.CR_OK)
return suspend_call.output().value;
else
return -1;
}
public int resume_game()
{
if (!suspend_ready)
return -1;
if (resume_call.execute(default_output()) == command_result.CR_OK)
return resume_call.output().value;
else
return -1;
}
//private:
bool active, delete_output;
public Socket socket;
color_ostream p_default_output;
RemoteFunction<dfproto.CoreBindRequest, dfproto.CoreBindReply> bind_call;
RemoteFunction<dfproto.CoreRunCommandRequest> runcmd_call;
bool suspend_ready;
RemoteFunction<EmptyMessage, IntMessage> suspend_call = new RemoteFunction<EmptyMessage,IntMessage>();
RemoteFunction<EmptyMessage, IntMessage> resume_call = new RemoteFunction<EmptyMessage,IntMessage>();
}
class RemoteSuspender
{
RemoteClient client;
public RemoteSuspender(RemoteClient clientIn)
{
client = clientIn;
if (client == null || client.suspend_game() <= 0) client = null;
}
~RemoteSuspender()
{
if (client != null) client.resume_game();
}
};
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 73b3c5754a89e43409dcf23866eb0484
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,690 +0,0 @@
#region Usings
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
#endregion
namespace AT.MIN
{
public static class Tools
{
#region Public Methods
#region IsNumericType
/// <summary>
/// Determines whether the specified value is of numeric type.
/// </summary>
/// <param name="o">The object to check.</param>
/// <returns>
/// <c>true</c> if o is a numeric type; otherwise, <c>false</c>.
/// </returns>
public static bool IsNumericType( object o )
{
return ( o is byte ||
o is sbyte ||
o is short ||
o is ushort ||
o is int ||
o is uint ||
o is long ||
o is ulong ||
o is float ||
o is double ||
o is decimal );
}
#endregion
#region IsPositive
/// <summary>
/// Determines whether the specified value is positive.
/// </summary>
/// <param name="Value">The value.</param>
/// <param name="ZeroIsPositive">if set to <c>true</c> treats 0 as positive.</param>
/// <returns>
/// <c>true</c> if the specified value is positive; otherwise, <c>false</c>.
/// </returns>
public static bool IsPositive( object Value, bool ZeroIsPositive )
{
switch ( Type.GetTypeCode( Value.GetType() ) )
{
case TypeCode.SByte:
return ( ZeroIsPositive ? (sbyte)Value >= 0 : (sbyte)Value > 0 );
case TypeCode.Int16:
return ( ZeroIsPositive ? (short)Value >= 0 : (short)Value > 0 );
case TypeCode.Int32:
return ( ZeroIsPositive ? (int)Value >= 0 : (int)Value > 0 );
case TypeCode.Int64:
return ( ZeroIsPositive ? (long)Value >= 0 : (long)Value > 0 );
case TypeCode.Single:
return ( ZeroIsPositive ? (float)Value >= 0 : (float)Value > 0 );
case TypeCode.Double:
return ( ZeroIsPositive ? (double)Value >= 0 : (double)Value > 0 );
case TypeCode.Decimal:
return ( ZeroIsPositive ? (decimal)Value >= 0 : (decimal)Value > 0 );
case TypeCode.Byte:
return ( ZeroIsPositive ? true : (byte)Value > 0 );
case TypeCode.UInt16:
return ( ZeroIsPositive ? true : (ushort)Value > 0 );
case TypeCode.UInt32:
return ( ZeroIsPositive ? true : (uint)Value > 0 );
case TypeCode.UInt64:
return ( ZeroIsPositive ? true : (ulong)Value > 0 );
case TypeCode.Char:
return ( ZeroIsPositive ? true : (char)Value != '\0' );
default:
return false;
}
}
#endregion
#region ToUnsigned
/// <summary>
/// Converts the specified values boxed type to its correpsonding unsigned
/// type.
/// </summary>
/// <param name="Value">The value.</param>
/// <returns>A boxed numeric object whos type is unsigned.</returns>
public static object ToUnsigned( object Value )
{
switch ( Type.GetTypeCode( Value.GetType() ) )
{
case TypeCode.SByte:
return (byte)( (sbyte)Value );
case TypeCode.Int16:
return (ushort)( (short)Value );
case TypeCode.Int32:
return (uint)( (int)Value );
case TypeCode.Int64:
return (ulong)( (long)Value );
case TypeCode.Byte:
return Value;
case TypeCode.UInt16:
return Value;
case TypeCode.UInt32:
return Value;
case TypeCode.UInt64:
return Value;
case TypeCode.Single:
return (UInt32)( (float)Value );
case TypeCode.Double:
return (ulong)( (double)Value );
case TypeCode.Decimal:
return (ulong)( (decimal)Value );
default:
return null;
}
}
#endregion
#region ToInteger
/// <summary>
/// Converts the specified values boxed type to its correpsonding integer
/// type.
/// </summary>
/// <param name="Value">The value.</param>
/// <returns>A boxed numeric object whos type is an integer type.</returns>
public static object ToInteger( object Value, bool Round )
{
switch ( Type.GetTypeCode( Value.GetType() ) )
{
case TypeCode.SByte:
return Value;
case TypeCode.Int16:
return Value;
case TypeCode.Int32:
return Value;
case TypeCode.Int64:
return Value;
case TypeCode.Byte:
return Value;
case TypeCode.UInt16:
return Value;
case TypeCode.UInt32:
return Value;
case TypeCode.UInt64:
return Value;
case TypeCode.Single:
return ( Round ? (int)Math.Round( (float)Value ) : (int)( (float)Value ) );
case TypeCode.Double:
return ( Round ? (long)Math.Round( (double)Value ) : (long)( (double)Value ) );
case TypeCode.Decimal:
return ( Round ? Math.Round( (decimal)Value ) : (decimal)Value );
default:
return null;
}
}
#endregion
#region UnboxToLong
public static long UnboxToLong( object Value, bool Round )
{
switch ( Type.GetTypeCode( Value.GetType() ) )
{
case TypeCode.SByte:
return (long)( (sbyte)Value );
case TypeCode.Int16:
return (long)( (short)Value );
case TypeCode.Int32:
return (long)( (int)Value );
case TypeCode.Int64:
return (long)Value;
case TypeCode.Byte:
return (long)( (byte)Value );
case TypeCode.UInt16:
return (long)( (ushort)Value );
case TypeCode.UInt32:
return (long)( (uint)Value );
case TypeCode.UInt64:
return (long)( (ulong)Value );
case TypeCode.Single:
return ( Round ? (long)Math.Round( (float)Value ) : (long)( (float)Value ) );
case TypeCode.Double:
return ( Round ? (long)Math.Round( (double)Value ) : (long)( (double)Value ) );
case TypeCode.Decimal:
return ( Round ? (long)Math.Round( (decimal)Value ) : (long)( (decimal)Value ) );
default:
return 0;
}
}
#endregion
#region ReplaceMetaChars
/// <summary>
/// Replaces the string representations of meta chars with their corresponding
/// character values.
/// </summary>
/// <param name="input">The input.</param>
/// <returns>A string with all string meta chars are replaced</returns>
public static string ReplaceMetaChars( string input )
{
return Regex.Replace( input, @"(\\)(\d{3}|[^\d])?", new MatchEvaluator( ReplaceMetaCharsMatch ) );
}
private static string ReplaceMetaCharsMatch( Match m )
{
// convert octal quotes (like \040)
if ( m.Groups[2].Length == 3 )
return Convert.ToChar( Convert.ToByte( m.Groups[2].Value, 8 ) ).ToString();
else
{
// convert all other special meta characters
//TODO: \xhhh hex and possible dec !!
switch ( m.Groups[2].Value )
{
case "0": // null
return "\0";
case "a": // alert (beep)
return "\a";
case "b": // BS
return "\b";
case "f": // FF
return "\f";
case "v": // vertical tab
return "\v";
case "r": // CR
return "\r";
case "n": // LF
return "\n";
case "t": // Tab
return "\t";
default:
// if neither an octal quote nor a special meta character
// so just remove the backslash
return m.Groups[2].Value;
}
}
}
#endregion
#region printf
public static void printf( string Format, params object[] Parameters )
{
Console.Write( Tools.sprintf( Format, Parameters ) );
}
#endregion
#region fprintf
public static void fprintf( TextWriter Destination, string Format, params object[] Parameters )
{
Destination.Write( Tools.sprintf( Format, Parameters ) );
}
#endregion
#region sprintf
public static string sprintf( string Format, params object[] Parameters )
{
#region Variables
StringBuilder f = new StringBuilder();
Regex r = new Regex( @"\%(\d*\$)?([\'\#\-\+ ]*)(\d*)(?:\.(\d+))?([hl])?([dioxXucsfeEgGpn%])" );
//"%[parameter][flags][width][.precision][length]type"
Match m = null;
string w = String.Empty;
int defaultParamIx = 0;
int paramIx;
object o = null;
bool flagLeft2Right = false;
bool flagAlternate = false;
bool flagPositiveSign = false;
bool flagPositiveSpace = false;
bool flagZeroPadding = false;
bool flagGroupThousands = false;
int fieldLength = 0;
int fieldPrecision = 0;
char shortLongIndicator = '\0';
char formatSpecifier = '\0';
char paddingCharacter = ' ';
#endregion
// find all format parameters in format string
f.Append( Format );
m = r.Match( f.ToString() );
while ( m.Success )
{
#region parameter index
paramIx = defaultParamIx;
if ( m.Groups[1] != null && m.Groups[1].Value.Length > 0 )
{
string val = m.Groups[1].Value.Substring( 0, m.Groups[1].Value.Length - 1 );
paramIx = Convert.ToInt32( val ) - 1;
};
#endregion
#region format flags
// extract format flags
flagAlternate = false;
flagLeft2Right = false;
flagPositiveSign = false;
flagPositiveSpace = false;
flagZeroPadding = false;
flagGroupThousands = false;
if ( m.Groups[2] != null && m.Groups[2].Value.Length > 0 )
{
string flags = m.Groups[2].Value;
flagAlternate = ( flags.IndexOf( '#' ) >= 0 );
flagLeft2Right = ( flags.IndexOf( '-' ) >= 0 );
flagPositiveSign = ( flags.IndexOf( '+' ) >= 0 );
flagPositiveSpace = ( flags.IndexOf( ' ' ) >= 0 );
flagGroupThousands = ( flags.IndexOf( '\'' ) >= 0 );
// positive + indicator overrides a
// positive space character
if ( flagPositiveSign && flagPositiveSpace )
flagPositiveSpace = false;
}
#endregion
#region field length
// extract field length and
// pading character
paddingCharacter = ' ';
fieldLength = int.MinValue;
if ( m.Groups[3] != null && m.Groups[3].Value.Length > 0 )
{
fieldLength = Convert.ToInt32( m.Groups[3].Value );
flagZeroPadding = ( m.Groups[3].Value[0] == '0' );
}
#endregion
if ( flagZeroPadding )
paddingCharacter = '0';
// left2right allignment overrides zero padding
if ( flagLeft2Right && flagZeroPadding )
{
flagZeroPadding = false;
paddingCharacter = ' ';
}
#region field precision
// extract field precision
fieldPrecision = int.MinValue;
if ( m.Groups[4] != null && m.Groups[4].Value.Length > 0 )
fieldPrecision = Convert.ToInt32( m.Groups[4].Value );
#endregion
#region short / long indicator
// extract short / long indicator
shortLongIndicator = Char.MinValue;
if ( m.Groups[5] != null && m.Groups[5].Value.Length > 0 )
shortLongIndicator = m.Groups[5].Value[0];
#endregion
#region format specifier
// extract format
formatSpecifier = Char.MinValue;
if ( m.Groups[6] != null && m.Groups[6].Value.Length > 0 )
formatSpecifier = m.Groups[6].Value[0];
#endregion
// default precision is 6 digits if none is specified except
if ( fieldPrecision == int.MinValue &&
formatSpecifier != 's' &&
formatSpecifier != 'c' &&
Char.ToUpper( formatSpecifier ) != 'X' &&
formatSpecifier != 'o' )
fieldPrecision = 6;
#region get next value parameter
// get next value parameter and convert value parameter depending on short / long indicator
if ( Parameters == null || paramIx >= Parameters.Length )
o = null;
else
{
o = Parameters[paramIx];
if ( shortLongIndicator == 'h' )
{
if ( o is int )
o = (short)( (int)o );
else if ( o is long )
o = (short)( (long)o );
else if ( o is uint )
o = (ushort)( (uint)o );
else if ( o is ulong )
o = (ushort)( (ulong)o );
}
else if ( shortLongIndicator == 'l' )
{
if ( o is short )
o = (long)( (short)o );
else if ( o is int )
o = (long)( (int)o );
else if ( o is ushort )
o = (ulong)( (ushort)o );
else if ( o is uint )
o = (ulong)( (uint)o );
}
}
#endregion
// convert value parameters to a string depending on the formatSpecifier
w = String.Empty;
switch ( formatSpecifier )
{
#region % - character
case '%': // % character
w = "%";
break;
#endregion
#region d - integer
case 'd': // integer
w = FormatNumber( ( flagGroupThousands ? "n" : "d" ), flagAlternate,
fieldLength, int.MinValue, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region i - integer
case 'i': // integer
goto case 'd';
#endregion
#region o - octal integer
case 'o': // octal integer - no leading zero
w = FormatOct( "o", flagAlternate,
fieldLength, int.MinValue, flagLeft2Right,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region x - hex integer
case 'x': // hex integer - no leading zero
w = FormatHex( "x", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region X - hex integer
case 'X': // same as x but with capital hex characters
w = FormatHex( "X", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region u - unsigned integer
case 'u': // unsigned integer
w = FormatNumber( ( flagGroupThousands ? "n" : "d" ), flagAlternate,
fieldLength, int.MinValue, flagLeft2Right,
false, false,
paddingCharacter, ToUnsigned( o ) );
defaultParamIx++;
break;
#endregion
#region c - character
case 'c': // character
if ( IsNumericType( o ) )
w = Convert.ToChar( o ).ToString();
else if ( o is char )
w = ( (char)o ).ToString();
else if ( o is string && ( (string)o ).Length > 0 )
w = ( (string)o )[0].ToString();
defaultParamIx++;
break;
#endregion
#region s - string
case 's': // string
//string t = "{0" + ( fieldLength != int.MinValue ? "," + ( flagLeft2Right ? "-" : String.Empty ) + fieldLength.ToString() : String.Empty ) + ":s}";
w = o.ToString();
if ( fieldPrecision >= 0 )
w = w.Substring( 0, fieldPrecision );
if ( fieldLength != int.MinValue )
if ( flagLeft2Right )
w = w.PadRight( fieldLength, paddingCharacter );
else
w = w.PadLeft( fieldLength, paddingCharacter );
defaultParamIx++;
break;
#endregion
#region f - double number
case 'f': // double
w = FormatNumber( ( flagGroupThousands ? "n" : "f" ), flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region e - exponent number
case 'e': // double / exponent
w = FormatNumber( "e", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region E - exponent number
case 'E': // double / exponent
w = FormatNumber( "E", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region g - general number
case 'g': // double / exponent
w = FormatNumber( "g", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region G - general number
case 'G': // double / exponent
w = FormatNumber( "G", flagAlternate,
fieldLength, fieldPrecision, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, o );
defaultParamIx++;
break;
#endregion
#region p - pointer
case 'p': // pointer
if ( o is IntPtr )
w = "0x" + ( (IntPtr)o ).ToString( "x" );
defaultParamIx++;
break;
#endregion
#region n - number of processed chars so far
case 'n': // number of characters so far
w = FormatNumber( "d", flagAlternate,
fieldLength, int.MinValue, flagLeft2Right,
flagPositiveSign, flagPositiveSpace,
paddingCharacter, m.Index );
break;
#endregion
default:
w = String.Empty;
defaultParamIx++;
break;
}
// replace format parameter with parameter value
// and start searching for the next format parameter
// AFTER the position of the current inserted value
// to prohibit recursive matches if the value also
// includes a format specifier
f.Remove( m.Index, m.Length );
f.Insert( m.Index, w );
m = r.Match( f.ToString(), m.Index + w.Length );
}
return f.ToString();
}
#endregion
#endregion
#region Private Methods
#region FormatOCT
private static string FormatOct( string NativeFormat, bool Alternate,
int FieldLength, int FieldPrecision,
bool Left2Right,
char Padding, object Value )
{
string w = String.Empty;
string lengthFormat = "{0" + ( FieldLength != int.MinValue ?
"," + ( Left2Right ?
"-" :
String.Empty ) + FieldLength.ToString() :
String.Empty ) + "}";
if ( IsNumericType( Value ) )
{
w = Convert.ToString( UnboxToLong( Value, true ), 8 );
if ( Left2Right || Padding == ' ' )
{
if ( Alternate && w != "0" )
w = "0" + w;
w = String.Format( lengthFormat, w );
}
else
{
if ( FieldLength != int.MinValue )
w = w.PadLeft( FieldLength - ( Alternate && w != "0" ? 1 : 0 ), Padding );
if ( Alternate && w != "0" )
w = "0" + w;
}
}
return w;
}
#endregion
#region FormatHEX
private static string FormatHex( string NativeFormat, bool Alternate,
int FieldLength, int FieldPrecision,
bool Left2Right,
char Padding, object Value )
{
string w = String.Empty;
string lengthFormat = "{0" + ( FieldLength != int.MinValue ?
"," + ( Left2Right ?
"-" :
String.Empty ) + FieldLength.ToString() :
String.Empty ) + "}";
string numberFormat = "{0:" + NativeFormat + ( FieldPrecision != int.MinValue ?
FieldPrecision.ToString() :
String.Empty ) + "}";
if ( IsNumericType( Value ) )
{
w = String.Format( numberFormat, Value );
if ( Left2Right || Padding == ' ' )
{
if ( Alternate )
w = ( NativeFormat == "x" ? "0x" : "0X" ) + w;
w = String.Format( lengthFormat, w );
}
else
{
if ( FieldLength != int.MinValue )
w = w.PadLeft( FieldLength - ( Alternate ? 2 : 0 ), Padding );
if ( Alternate )
w = ( NativeFormat == "x" ? "0x" : "0X" ) + w;
}
}
return w;
}
#endregion
#region FormatNumber
private static string FormatNumber( string NativeFormat, bool Alternate,
int FieldLength, int FieldPrecision,
bool Left2Right,
bool PositiveSign, bool PositiveSpace,
char Padding, object Value )
{
string w = String.Empty;
string lengthFormat = "{0" + ( FieldLength != int.MinValue ?
"," + ( Left2Right ?
"-" :
String.Empty ) + FieldLength.ToString() :
String.Empty ) + "}";
string numberFormat = "{0:" + NativeFormat + ( FieldPrecision != int.MinValue ?
FieldPrecision.ToString() :
"0" ) + "}";
if ( IsNumericType( Value ) )
{
w = String.Format( numberFormat, Value );
if ( Left2Right || Padding == ' ' )
{
if ( IsPositive( Value, true ) )
w = ( PositiveSign ?
"+" : ( PositiveSpace ? " " : String.Empty ) ) + w;
w = String.Format( lengthFormat, w );
}
else
{
if ( w.StartsWith( "-" ) )
w = w.Substring( 1 );
if ( FieldLength != int.MinValue )
w = w.PadLeft( FieldLength - 1, Padding );
if ( IsPositive( Value, true ) )
w = ( PositiveSign ?
"+" : ( PositiveSpace ?
" " : ( FieldLength != int.MinValue ?
Padding.ToString() : String.Empty ) ) ) + w;
else
w = "-" + w;
}
}
return w;
}
#endregion
#endregion
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 364a32494f42e934bae30ff47badc45a
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

File diff suppressed because one or more lines are too long

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: eb0b853da2a60f540a81dc515bab1875
DefaultImporter:
userData:

@ -1,21 +0,0 @@
using DFHack;
using System.Collections.Generic;
using UnityEngine;
public class TestScript : MonoBehaviour {
RemoteClient remoteClient = new RemoteClient();
// Use this for initialization
void Start () {
if (!remoteClient.connect())
Debug.LogError("Could not connect");
else
{
remoteClient.run_command("ls", new List<string>());
}
}
// Update is called once per frame
void Update () {
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e85d437f881938247992e492006de2df
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,78 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UV Test
m_Shader: {fileID: 4800000, guid: ff990239cc3bc4a45a362f932463d378, type: 3}
m_ShaderKeywords: []
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: d420514133a0fbd4990025b3e1dac764, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _Detail
second:
m_Texture: {fileID: 2800000, guid: d420514133a0fbd4990025b3e1dac764, type: 3}
m_Scale: {x: 16, y: 16}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DecalTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _LightMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: .154818445
data:
first:
name: _Parallax
second: .0199999996
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Emission
second: {r: 0, g: 0, b: 0, a: 0}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: fcc33854b846d0e4aa14f8afb74e173b
NativeFormatImporter:
userData:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

@ -1,36 +0,0 @@
fileFormatVersion: 2
guid: ffba25341839373409b0cd511e9b1761
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
userData:

@ -1,31 +0,0 @@
Shader " Vertex Colored"
{
Properties
{
_Color ("Diffuse Color", Color) = (1,1,1,1)
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input
{
float2 uv_MainTex;
float4 color: Color; // Vertex color
};
sampler2D _MainTex;
fixed4 _Color;
void surf (Input IN, inout SurfaceOutput o)
{
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
o.Albedo *= _Color;
o.Albedo *= IN.color.rgb;
}
ENDCG
}
Fallback "Diffuse", 1
}

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: ff990239cc3bc4a45a362f932463d378
ShaderImporter:
defaultTextures: []
userData:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

@ -1,36 +0,0 @@
fileFormatVersion: 2
guid: d420514133a0fbd4990025b3e1dac764
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
userData:

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 8946b1d409fcda6499e46ca0fd310b73
MonoAssemblyImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
userData:

@ -1,205 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
AndroidProfiler: 0
defaultScreenOrientation: 0
targetDevice: 2
targetGlesGraphics: 1
targetResolution: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: simple_sample
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_RenderingPath: 1
m_ActiveColorSpace: 0
m_MTRendering: 1
m_UseDX11: 0
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
displayResolutionDialog: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
use24BitDepthBuffer: 0
defaultIsFullScreen: 0
defaultIsNativeResolution: 1
runInBackground: 0
captureSingleScreen: 0
Override IPod Music: 0
Prepare IOS For Recording: 0
enableHWStatistics: 1
usePlayerLog: 1
stripPhysics: 0
forceSingleInstance: 0
resizableWindow: 0
useMacAppStoreValidation: 0
gpuSkinning: 1
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
macFullscreenMode: 2
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
wiiHio2Usage: -1
wiiLoadingScreenRectPlacement: 0
wiiLoadingScreenBackground: {r: 1, g: 1, b: 1, a: 1}
wiiLoadingScreenPeriod: 1000
wiiLoadingScreenFileName:
wiiLoadingScreenRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
iPhoneBundleIdentifier: com.Company.ProductName
productGUID: f7b388f2ff8d5f9428acfb790895bdce
iPhoneBundleVersion: 1.0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 6
AndroidPreferredInstallLocation: 1
aotOptions:
apiCompatibilityLevel: 2
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
StripUnusedMeshComponents: 0
iPhoneSdkVersion: 988
iPhoneTargetOSVersion: 10
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
iPhoneSplashScreen: {fileID: 0}
iPhoneHighResSplashScreen: {fileID: 0}
iPhoneTallHighResSplashScreen: {fileID: 0}
iPadPortraitSplashScreen: {fileID: 0}
iPadHighResPortraitSplashScreen: {fileID: 0}
iPadLandscapeSplashScreen: {fileID: 0}
iPadHighResLandscapeSplashScreen: {fileID: 0}
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
AndroidKeystoreName:
AndroidKeyaliasName:
resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons:
- m_BuildTarget:
m_Icons:
- m_Icon: {fileID: 0}
m_Size: 128
m_BuildTargetBatching: []
webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {}
wiiRegion: 1
wiiGameCode: RABA
wiiGameVersion:
wiiCompanyCode: ZZ
wiiSupportsNunchuk: 0
wiiSupportsClassicController: 0
wiiSupportsBalanceBoard: 0
wiiSupportsMotionPlus: 0
wiiControllerCount: 1
wiiFloatingPointExceptions: 0
wiiScreenCrashDumps: 1
XboxTitleId:
XboxImageXexPath:
XboxSpaPath:
XboxGenerateSpa: 0
XboxDeployKinectResources: 0
XboxSplashScreen: {fileID: 0}
xboxEnableSpeech: 0
xboxAdditionalTitleMemorySize: 0
xboxDeployKinectHeadOrientation: 0
xboxDeployKinectHeadPosition: 0
ps3TitleConfigPath:
ps3DLCConfigPath:
ps3ThumbnailPath:
ps3BackgroundPath:
ps3SoundPath:
ps3TrophyCommId:
ps3NpCommunicationPassphrase:
ps3TrophyPackagePath:
ps3BootCheckMaxSaveGameSizeKB: 128
ps3TrophyCommSig:
ps3SaveGameSlots: 1
ps3TrialMode: 0
flashStrippingLevel: 2
scriptingDefineSymbols:
data:
first: 1
second:
data:
first: 4
second:
data:
first: 7
second:
data:
first: 11
second:
metroPackageName: simple_sample
metroPackageLogo:
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: simple_sample
metroTileLogo:
metroTileWideLogo:
metroTileSmallLogo:
metroTileShortName:
metroCommandLineArgsFile:
metroTileShowName: 0
metroTileForegroundText: 1
metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
metroSplashScreenImage:
metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
metroSplashScreenUseBackgroundColor: 0
metroCapabilities: {}
metroCompilationOverrides: 1
blackberryDeviceAddress:
blackberryDevicePassword:
blackberryTokenPath:
blackberryTokenExires:
blackberryTokenAuthor:
blackberryTokenAuthorId:
blackberryAuthorId:
blackberryCskPassword:
blackberrySaveLogPath:
blackberryAuthorIdOveride: 0
blackberrySharedPermissions: 0
blackberryCameraPermissions: 0
blackberryGPSPermissions: 0
blackberryDeviceIDPermissions: 0
blackberryMicrophonePermissions: 0
blackberryBuildId: 0
blackberryLandscapeSplashScreen: {fileID: 0}
blackberryPortraitSplashScreen: {fileID: 0}
blackberrySquareSplashScreen: {fileID: 0}
firstStreamedLevelWithResources: 0
unityRebuildLibraryVersion: 9
unityForwardCompatibleVersion: 38
unityStandardAssetsVersion: 0

Some files were not shown because too many files have changed in this diff Show More