Пример #1
0
        internal ObjectLayer(ContentReader reader, ObjectRegistry registry)
            : base(reader)
        {
            _registry = registry;
            _objects = new List<ObjectInstance>();

            int objCount = reader.ReadInt32();
            for (int i = 0; i < objCount; i++) {
                int id = reader.ReadInt32();
                int dx = reader.ReadInt32();
                int dy = reader.ReadInt32();
                float rotation = reader.ReadSingle();
                float scaleX = reader.ReadSingle();
                float scaleY = reader.ReadSingle();

                PropertyCollection properties = new PropertyCollection(reader);

                _objects.Add(new ObjectInstance(_registry.GetObjectPool(id), id, dx, dy) {
                    Rotation = rotation,
                    ScaleX = scaleX,
                    ScaleY = scaleY,
                    Properties = properties,
                });
            }
        }
Пример #2
0
        internal ObjectLayer(ContentReader reader, ObjectRegistry registry)
            : base(reader)
        {
            _registry = registry;
            _objects  = new List <ObjectInstance>();

            int objCount = reader.ReadInt32();

            for (int i = 0; i < objCount; i++)
            {
                int   id       = reader.ReadInt32();
                int   dx       = reader.ReadInt32();
                int   dy       = reader.ReadInt32();
                float rotation = reader.ReadSingle();
                float scaleX   = reader.ReadSingle();
                float scaleY   = reader.ReadSingle();

                PropertyCollection properties = new PropertyCollection(reader);

                _objects.Add(new ObjectInstance(_registry.GetObjectPool(id), id, dx, dy)
                {
                    Rotation   = rotation,
                    ScaleX     = scaleX,
                    ScaleY     = scaleY,
                    Properties = properties,
                });
            }
        }
Пример #3
0
        internal ObjectLayer(ContentReader reader, ObjectRegistry registry)
            : base(reader)
        {
            _registry = registry;
            _objects = new List<ObjectInstance>();

            int objCount = reader.ReadInt32();
            for (int i = 0; i < objCount; i++) {
                int dx = reader.ReadInt32();
                int dy = reader.ReadInt32();
                int id = reader.ReadInt16();

                _objects.Add(new ObjectInstance(_registry.GetObjectPool(id), id, dx, dy));
            }
        }
Пример #4
0
 internal Level()
 {
     _tileRegistry   = new TileRegistry();
     _objectRegistry = new ObjectRegistry();
     _layers         = new List <Layer>();
 }
Пример #5
0
 internal Level()
 {
     _tileRegistry = new TileRegistry();
     _objectRegistry = new ObjectRegistry();
     _layers = new List<Layer>();
 }