Treefrog.Runtime.ObjectRegistry.GetObjectPool C# (CSharp) Method

GetObjectPool() public method

public GetObjectPool ( int id ) : ObjectPool
id int
return ObjectPool
        public ObjectPool GetObjectPool(int id)
        {
            return _registry[id];
        }

Usage Example

Example #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,
                });
            }
        }
All Usage Examples Of Treefrog.Runtime.ObjectRegistry::GetObjectPool