CNCMaps.Engine.Game.Theater.GetObjectCollection C# (CSharp) Метод

GetObjectCollection() публичный Метод

public GetObjectCollection ( GameObject o ) : CNCMaps.Engine.Game.GameCollection
o CNCMaps.Engine.Map.GameObject
Результат CNCMaps.Engine.Game.GameCollection
        public GameCollection GetObjectCollection(GameObject o)
        {
            if (o is InfantryObject) return _infantryTypes;
            else if (o is UnitObject) return _vehicleTypes;
            else if (o is AircraftObject) return _aircraftTypes;
            else if (o is StructureObject) {
                if (_buildingTypes.HasObject(o))
                    return _buildingTypes;
                else
                    return _overlayTypes;
            }
            else if (o is OverlayObject) return _overlayTypes;
            else if (o is TerrainObject) return _terrainTypes;
            else if (o is SmudgeObject) return _smudgeTypes;
            else if (o is AnimationObject) return _animations;
            else if (o is MapTile) return _tileTypes;
            else return null;
        }

Usage Example

Пример #1
0
 private void SetDrawables()
 {
     foreach (var tile in _tiles)
     {
         tile.Drawable = _theater.GetCollection(CollectionType.Tiles).GetDrawable(tile);
         foreach (var obj in tile.AllObjects)
         {
             obj.Collection = _theater.GetObjectCollection(obj);
             obj.Drawable   = obj.Collection.GetDrawable(obj);
         }
     }
 }