示例#1
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("_changedShape = [");
            var doneWithFirst = false;

            foreach (var entity in _changedShape)
            {
                if (doneWithFirst)
                {
                    w.Write(", ");
                }
                doneWithFirst = true;
                w.Write(entity);
            }
            w.Write("]");

            w.AppendIndent(indent).Write("_changedMass = [");
            doneWithFirst = false;
            foreach (var entity in _changedMass)
            {
                if (doneWithFirst)
                {
                    w.Write(", ");
                }
                doneWithFirst = true;
                w.Write(entity);
            }
            w.Write("]");

            return(w);
        }
示例#2
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("LivingCells = {");
            {
                var first = true;
                foreach (var cell in _livingCells)
                {
                    if (!first)
                    {
                        w.Write(", ");
                    }
                    first = false;
                    w.Write(cell);
                }
            }
            w.Write("}");
            w.AppendIndent(indent).Write("PendingCells {");
            {
                var first = true;
                foreach (var cell in _pendingCells)
                {
                    if (!first)
                    {
                        w.Write(", ");
                    }
                    first = false;
                    w.Write(cell.Key);
                    w.Write("@");
                    w.Write(cell.Value);
                }
            }
            w.Write("}");

            return(w);
        }
示例#3
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Trees = {");
            for (var i = 0; i < _nextIndexId; ++i)
            {
                var tree = _trees[i];
                if (tree == null)
                {
                    continue;
                }
                w.AppendIndent(indent + 1).Write(i);
                w.Write(" = ");
                w.Dump(tree, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            w.AppendIndent(indent).Write("Changed = {");
            var first = true;

            foreach (var component in _changed)
            {
                if (!first)
                {
                    w.Write(", ");
                }
                first = false;
                w.Write(component);
            }
            w.Write("}");

            return(w);
        }
示例#4
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("CurrentBehaviors = {");
            {
                var first = true;
                foreach (var behavior in _currentBehaviors)
                {
                    if (!first)
                    {
                        w.Write(", ");
                    }
                    first = false;
                    w.Write(behavior);
                }
            }
            w.Write("}");

            w.AppendIndent(indent).Write("Behaviors = {");
            foreach (var behavior in _behaviors)
            {
                w.AppendIndent(indent + 1).Write(behavior.Key);
                w.Write(" = ");
                w.Dump(behavior.Value, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#5
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Squads = {");
            foreach (var id in _squadIds)
            {
                var data = _squads[id];

                w.AppendIndent(indent + 1).Write(id);
                w.Write(" = {");
                w.AppendIndent(indent + 2).Write("Formation = ");
                w.Write(data.Formation.GetType().Name);
                w.AppendIndent(indent + 2).Write("Spacing = ");
                w.Write(data.Spacing);
                w.AppendIndent(indent + 2).Write("MemberCount = ");
                w.Write(data.Members.Count);
                w.AppendIndent(indent + 2).Write("Members = {");
                for (var i = 0; i < data.Members.Count; i++)
                {
                    if (i > 0)
                    {
                        w.Write(", ");
                    }
                    w.Write(data.Members[i]);
                }
                w.AppendIndent(indent + 2).Write("}");
                w.AppendIndent(indent + 1).Write("}");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#6
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Commands = {");
            foreach (var command in Commands)
            {
                w.AppendIndent(indent + 1).Dump(command, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#7
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Effects = {");
            foreach (var effect in Effects)
            {
                w.AppendIndent(indent + 1).Dump(effect, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#8
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Modifiers = {");
            foreach (var modifier in Modifiers)
            {
                w.AppendIndent(indent + 1).Dump(modifier, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#9
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Cooldowns = {");
            foreach (var cooldown in _cooldowns)
            {
                w.AppendIndent(indent + 1).Write(cooldown.Key);
                w.Write(" = ");
                w.Write(cooldown.Value);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#10
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            // Write the components.
            w.AppendIndent(indent).Write("ComponentCount = ");
            w.Write(_componentIds.Count);
            w.AppendIndent(indent).Write("Components = {");
            foreach (var component in Components)
            {
                w.AppendIndent(indent + 1).Write(component.GetType());
                w.Write(" = ");
                w.Dump(component, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            // Write systems.
            w.AppendIndent(indent).Write("SystemCount (excluding IDrawingSystems) = ");
            w.Write(_systems.Count(Packetizable.IsPacketizable));
            w.AppendIndent(indent).Write("Systems = {");
            for (int i = 0, j = _systems.Count; i < j; ++i)
            {
                if (!Packetizable.IsPacketizable(_systems[i]))
                {
                    continue;
                }
                w.AppendIndent(indent + 1).Write(_systems[i].GetType());
                w.Write(" = ");
                w.Dump(_systems[i], indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#11
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("CellCount = ");
            w.Write(_cells.Count);
            w.AppendIndent(indent).Write("Cells = {");
            foreach (var entry in _cells)
            {
                w.AppendIndent(indent + 1).Write(entry.Key);
                w.Write(" = ");
                w.Dump(entry.Value, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            w.AppendIndent(indent).Write("EntryCount = ");
            w.Write(_entryBounds.Count);
            w.AppendIndent(indent).Write("Entries = {");
            foreach (var entry in _entryBounds)
            {
                w.AppendIndent(indent + 1).Write(entry.Key);
                w.Write(" = ");
                w.Dump(entry.Value, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#12
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("_cellSpawns = {");
            foreach (var entry in _cellSpawns)
            {
                w.AppendIndent(indent + 1).Write("(");
                w.Write(entry.Item1);
                w.Write(", ");
                w.Write(entry.Item2);
                w.Write(")");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#13
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("StoredCellCount = ");
            w.Write(_cellInfo.Count);
            w.AppendIndent(indent).Write("Cells = {");
            foreach (var item in _cellInfo)
            {
                w.AppendIndent(indent + 1).Write(item.Key);
                w.Write(" = ");
                w.Dump(item.Value, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#14
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Start = ");
            w.Write(_start.HasValue ? _start.Value.ToString() : "null");

            return(w);
        }
示例#15
0
文件: Shield.cs 项目: matrix4x4/Space
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Factory = ");
            w.Write(Factory.Name);

            return(w);
        }
示例#16
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("BaseAttributes = {");
            foreach (var attribute in _baseAttributes)
            {
                w.AppendIndent(indent + 1).Write(Enum.GetName(typeof(TAttribute), attribute.Key));
                w.Write(" = ");
                w.Write(attribute.Value);
            }
            w.AppendIndent(indent).Write("}");

            w.AppendIndent(indent).Write("ModifiedAttributes = {");
            foreach (var attribute in _modifiedAttributes)
            {
                w.AppendIndent(indent + 1).Write(Enum.GetName(typeof(TAttribute), attribute.Key));
                w.Write(" = {Additive:");
                w.Write(attribute.Value[0]);
                w.Write(" Multiplicative:");
                w.Write(attribute.Value[1]);
                w.Write("}");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#17
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("_newCollisions = {");
            foreach (var info in _newCollisions)
            {
                w.AppendIndent(indent + 1).Write(info.Key);
                w.Write(" = { Count = ");
                w.Write(info.Value.Count);
                w.Write(", IsShieldA = ");
                w.Write(info.Value.IsShieldA);
                w.Write(", IsShieldB = ");
                w.Write(info.Value.IsShieldB);
                w.Write(", Normal = ");
                w.Write(info.Value.Normal);
                w.Write(" }");
            }
            w.AppendIndent(indent).Write("}");

            w.AppendIndent(indent).Write("_activeCollisions = {");
            foreach (var info in _activeCollisions)
            {
                w.AppendIndent(indent + 1).Write(info.Key);
                w.Write(" = { Count = ");
                w.Write(info.Value.Count);
                w.Write(" }");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#18
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            var hasher = new Hasher();

            for (var i = 0; i < N; i++)
            {
                hasher.Write(_mt[i]);
            }
            w.AppendIndent(indent).Write("hash(_mt) = ");
            w.Write(hasher.Value);

            return(w);
        }
示例#19
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Capacity = ");
            w.Write(Capacity);
            w.AppendIndent(indent).Write("Count = ");
            w.Write(Count);

            // Write actual item ids with their positions.
            w.AppendIndent(indent).Write("Items = {");
            for (var i = 0; i < _items.Count; i++)
            {
                var itemEntry = _items[i];
                if (itemEntry <= 0)
                {
                    continue;
                }
                w.AppendIndent(indent + 1).Write(i);
                w.Write(" = ");
                w.Write(itemEntry);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#20
0
 private static StreamWriter AppendValue([NotNull] this StreamWriter w, [CanBeNull] object value, int indent)
 {
     // Most simple case is if we have null...
     if (value == null)
     {
         w.Write("null");
     }
     else
     {
         // We're still here, get a writing function for the object.
         w.Write('{');
         GetAppender(value.GetType())(w, value, indent + 1);
         w.AppendIndent(indent).Write('}');
     }
     return(w);
 }
示例#21
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Targets = {");
            var first = true;

            foreach (var target in Targets)
            {
                if (!first)
                {
                    w.Write(", ");
                }
                first = false;
                w.Write(target);
            }
            w.Write("}");

            return(w);
        }
示例#22
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("_reusableIds = {");
            var first = true;

            foreach (var reusableId in _reusableIds)
            {
                if (!first)
                {
                    w.Write(", ");
                }
                w.Write(reusableId);
                first = false;
            }
            w.Write("}");

            return(w);
        }
示例#23
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("ComponentsToDisable = {");
            var first = true;

            foreach (var component in ComponentsToDisable)
            {
                if (!first)
                {
                    w.Write(", ");
                }
                first = false;
                w.Write(component);
            }
            w.Write("}");

            return(w);
        }
示例#24
0
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Vertices = {");
            for (var i = 0; i < Count; i++)
            {
                w.AppendIndent(indent + 1).Write("{");
                w.AppendIndent(indent + 2).Write("Position = ");
                w.Write(Vertices[i]);
                w.AppendIndent(indent + 2).Write("Normal = ");
                w.Write(Normals[i]);
                w.AppendIndent(indent + 1).Write("}");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#25
0
文件: Weapon.cs 项目: matrix4x4/Space
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            w.AppendIndent(indent).Write("Attributes = {");
            foreach (var attribute in Attributes)
            {
                w.AppendIndent(indent + 1).Write(attribute.Key);
                w.Write(" = ");
                w.Write(attribute.Value);
            }
            w.AppendIndent(indent).Write("}");

            w.AppendIndent(indent).Write("Projectiles = {");
            foreach (var projectile in Projectiles)
            {
                w.AppendIndent(indent + 1).Dump(projectile, indent + 1);
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }
示例#26
0
文件: TSS.cs 项目: matrix4x4/Space
        public StreamWriter Dump(StreamWriter w, int indent)
        {
            // Write the trailing simulation.
            w.AppendIndent(indent).Write("TrailingSimulation = ");
            w.Dump(_simulations[_simulations.Length - 1], indent);

            // Write pending object removals.
            w.AppendIndent(indent).Write("PendingRemovalFrameCount = ");
            w.Write(_removes.Count);
            w.AppendIndent(indent).Write("PendingRemovals = {");
            foreach (var frame in _removes)
            {
                w.AppendIndent(indent + 1).Write("Frame ");
                w.Write(frame.Key);
                w.Write(" = {");
                var first = true;
                foreach (var entity in frame.Value)
                {
                    if (!first)
                    {
                        w.Write(", ");
                    }
                    first = false;
                    w.Write(entity);
                }
                w.Write("}");
            }
            w.AppendIndent(indent).Write("}");

            // Write pending simulation commands.
            w.AppendIndent(indent).Write("CommandFrameCount = ");
            w.Write(_commands.Count);
            w.AppendIndent(indent).Write("Commands = {");
            foreach (var frame in _commands)
            {
                w.AppendIndent(indent + 1).Write("Frame ");
                w.Write(frame.Key);
                w.Write(" = {");
                foreach (var command in frame.Value)
                {
                    w.AppendIndent(indent + 1).Dump(command, indent + 1);
                }
                w.AppendIndent(indent + 1).Write("}");
            }
            w.AppendIndent(indent).Write("}");

            return(w);
        }