コード例 #1
0
ファイル: ObjectLayer.cs プロジェクト: Elof3/Treefrog
        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
ファイル: ObjectLayer.cs プロジェクト: Jorch72/CS-Treefrog
        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
ファイル: ObjectLayer.cs プロジェクト: JuliaABurch/Treefrog
        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
ファイル: Level.cs プロジェクト: Jorch72/CS-Treefrog
 internal Level()
 {
     _tileRegistry   = new TileRegistry();
     _objectRegistry = new ObjectRegistry();
     _layers         = new List <Layer>();
 }
コード例 #5
0
ファイル: Level.cs プロジェクト: JuliaABurch/Treefrog
 internal Level()
 {
     _tileRegistry = new TileRegistry();
     _objectRegistry = new ObjectRegistry();
     _layers = new List<Layer>();
 }