Beispiel #1
0
        public void Deserialize(AtmoReader reader) {
            ResourceName = reader.Solver.Solve(reader.ReadString());
            switch (ResourceName) {
                case "EOF":
                    throw new EndOfStreamException("Found EOF item");
                case "Rulebook":
                    Rulebook = reader.Read<Rulebook>();
                    return;
            }
            Position = reader.Read<FloatVector>();
            Rotation = reader.Read<ByteVector>();
            Scale = reader.ReadSingle();

            var propCount = reader.ReadByte();
            Properties = new Dictionary<string, string>(propCount);
            for (var i = 0; i < propCount; i++) {
                var key = reader.Solver.Solve(reader.ReadString());
                var value = reader.ReadString();
                Properties[key] = value;
            }
        }
 private static Vector MakeVector(ByteVector vector) => new Vector(vector.X, vector.Y, vector.Z) * 2;