Ejemplo n.º 1
0
        private static EntityPathNode ReadPathNode(Stream stream)
        {
            var pathNode = new EntityPathNode();

            pathNode.Position     = ReadVector3D(stream);
            pathNode.Index        = stream.ReadInt();
            pathNode.NameOverride = stream.ReadString(128);

            var propertyCount = stream.ReadInt();

            for (int i = 0; i < propertyCount; i++)
            {
                pathNode.Properties[stream.ReadNString()] = stream.ReadNString();
            }

            return(pathNode);
        }
Ejemplo n.º 2
0
        private static EntityPathNode ReadPathNode(Stream stream)
        {
            var node = new EntityPathNode();

            node.NameOverride = stream.ReadLengthPrefixedString();

            var fireOnTarget = stream.ReadLengthPrefixedString();

            if (!string.IsNullOrEmpty(fireOnTarget))
            {
                node.Properties[Attributes.Message] = fireOnTarget;
            }

            node.Position = ReadVector3D(stream);

            var angles = ReadAngles(stream);

            if (angles.Pitch != 0 || angles.Yaw != 0 || angles.Roll != 0)
            {
                node.Properties[Attributes.Angles] = FormattableString.Invariant($"{angles.Pitch} {angles.Yaw} {angles.Roll}");
            }

            var flags = (Flags)stream.ReadInt();
            var color = ReadColor(stream);

            var propertyCount = stream.ReadInt();

            for (int i = 0; i < propertyCount; i++)
            {
                var key   = stream.ReadLengthPrefixedString();
                var value = stream.ReadLengthPrefixedString();
                node.Properties[key] = value;
            }

            return(node);
        }