Example #1
0
        public override Color GetCurrentLightingColor(LightingColorType type)
        {
            if (this.lightingData == null)
            {
                return(this.defaultColor);
            }
            Gradient gradient = null;

            switch (type)
            {
            case LightingColorType.BuildingColorDark:
                gradient = this.lightingData.buildingsDark[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.BuildingColorLight:
                gradient = this.lightingData.buildingsLight[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.UnitColor:
                gradient = this.lightingData.units[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.ShadowColor:
                gradient = this.lightingData.shadow[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.GroundColor:
                gradient = this.lightingData.terrainDark[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.GroundColorLight:
                gradient = this.lightingData.terrainLight[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.GridColor:
                gradient = this.lightingData.gridColor[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.BuildingGridColor:
                gradient = this.lightingData.buildingGridColor[(int)this.timeOfDaySegment];
                break;

            case LightingColorType.WallGridColor:
                gradient = this.lightingData.wallGridColor[(int)this.timeOfDaySegment];
                break;
            }
            if (gradient == null)
            {
                Service.Logger.Error("Invalid Color Type; Type: " + type.ToString());
                return(this.defaultColor);
            }
            return(gradient.Evaluate((float)this.segmentPercentage));
        }
Example #2
0
        public override Color GetCurrentLightingColor(LightingColorType type)
        {
            if (this.planetVO == null)
            {
                return(this.defaultColor);
            }
            DefaultLightingVO defaultLightingVO = Service.Get <IDataController>().Get <DefaultLightingVO>(this.planetVO.PlanetaryLighting);
            string            hexColor          = "";

            switch (type)
            {
            case LightingColorType.BuildingColorDark:
                hexColor = defaultLightingVO.LightingColorDark;
                break;

            case LightingColorType.BuildingColorLight:
                hexColor = defaultLightingVO.LightingColorLight;
                break;

            case LightingColorType.UnitColor:
                hexColor = defaultLightingVO.LightingColorMedian;
                break;

            case LightingColorType.ShadowColor:
                hexColor = defaultLightingVO.LightingColorShadow;
                break;

            case LightingColorType.GroundColor:
                hexColor = defaultLightingVO.LightingColorGround;
                break;

            case LightingColorType.GroundColorLight:
                hexColor = defaultLightingVO.LightingColorGroundLight;
                break;

            case LightingColorType.GridColor:
                hexColor = defaultLightingVO.LightingColorGrid;
                break;

            case LightingColorType.WallGridColor:
                hexColor = defaultLightingVO.LightingColorWallGrid;
                break;
            }
            return(FXUtils.ConvertHexStringToColorObject(hexColor));
        }
Example #3
0
 public Color GetCurrentLightingColor(LightingColorType type)
 {
     return(this.LightingEffects.GetCurrentLightingColor(type));
 }
Example #4
0
 public virtual Color GetCurrentLightingColor(LightingColorType type)
 {
     return(this.defaultColor);
 }