Example #1
0
        /// <summary>
        /// Adds the given <see cref="AssetBase"/> to the <see cref="Asset.BaseParts"/> collection of this asset.
        /// </summary>
        /// <remarks>If the <see cref="Asset.BaseParts"/> collection already contains the argument. this method does nothing.</remarks>
        /// <param name="newBasePart">The base to add to the <see cref="Asset.BaseParts"/> collection.</param>
        public void AddBasePart(AssetBase newBasePart)
        {
            if (newBasePart == null)
            {
                throw new ArgumentNullException(nameof(newBasePart));
            }

            if (BaseParts == null)
            {
                BaseParts = new List <AssetBase>();
            }

            if (BaseParts.All(x => x.Id != newBasePart.Id))
            {
                BaseParts.Add(newBasePart);
            }
        }
Example #2
0
        public void AddParts(BasePartsUI basePartsUI)
        {
            BaseParts BaseParts = null;

            if (basePartsUI is EngineUI)
            {
                BaseParts = ConvertToEngine(basePartsUI as EngineUI);
            }
            else if (basePartsUI is GearboxUI)
            {
                BaseParts = ConvertTOGearbox(basePartsUI as GearboxUI);
            }
            else if (basePartsUI is InteriorUI)
            {
                BaseParts = ConvertTOInterior(basePartsUI as InteriorUI);
            }
            else if (basePartsUI is ExteriorUI)
            {
                BaseParts = ConvertTOExterior(basePartsUI as ExteriorUI);
            }
            _WCF.AddParts(BaseParts);
        }
Example #3
0
        public BasePartsUI ConvertoToBasePartsUI(BaseParts baseParts)
        {
            BasePartsUI basePartsUI = null;

            if (baseParts is Engine)
            {
                basePartsUI = ConvertToEngineUI(baseParts as Engine);
            }
            else if (baseParts is Gearbox)
            {
                basePartsUI = ConvertToGearBoxUI(baseParts as Gearbox);
            }
            else if (baseParts is Interior)
            {
                basePartsUI = ConvertToInteriorUI(baseParts as Interior);
            }
            else if (baseParts is Exterior)
            {
                basePartsUI = ConvertToExteriorUI(baseParts as Exterior);
            }
            return(basePartsUI);
        }
Example #4
0
        public void ModifyParts(BaseParts baseParts)
        {
            BaseClassDTO baseClassDTO = null;

            if (baseParts is Engine)
            {
                baseClassDTO = ConvertToEngineDTO(baseParts as Engine);
            }
            else if (baseParts is Gearbox)
            {
                baseClassDTO = ConvertTOGearboxDTO(baseParts as Gearbox);
            }
            else if (baseParts is Interior)
            {
                baseClassDTO = ConvertTOInteriorDTO(baseParts as Interior);
            }
            else if (baseParts is Exterior)
            {
                baseClassDTO = ConvertTOExteriorDTO(baseParts as Exterior);
            }
            _bll.ModifyParts(baseClassDTO);
        }
Example #5
0
    //ColorUpdate
    static private StatusInfoPartsProcess ColorUpdateUpdate(StatusInfoPartsProcessState mine, StatusInfoParts statusInfoParts)
    {
        if (statusInfoParts.GetTimeCounter().measure(Time.deltaTime, statusInfoParts.GetTimeRegulation()))
        {
            BaseParts  baseParts  = statusInfoParts.GetBaseParts();
            FrameParts frameParts = statusInfoParts.GetFrameParts();

            baseParts.GetBaseSprite().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetBaseSprite().color)
                , statusInfoParts.GetTimeFlucts(0)
                , 255
                , statusInfoParts.GetTimeRegulation()
                , statusInfoParts.GetTimeRegulation()
                );
            baseParts.GetHpLogoText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetHpLogoText().color)
                , statusInfoParts.GetTimeFlucts(1)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeRegulation()
                , statusInfoParts.GetTimeRegulation()
                );
            baseParts.GetInfoNameEventText().GetText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetInfoNameEventText().GetText().color)
                , statusInfoParts.GetTimeFlucts(2)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeRegulation()
                , statusInfoParts.GetTimeRegulation()
                );

            frameParts.GetFrameSprite().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(frameParts.GetFrameSprite().color)
                , statusInfoParts.GetTimeFlucts(4)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeRegulation()
                , statusInfoParts.GetTimeRegulation()
                );
            if (frameParts.GetHpGaugeParts().GetInfoText() != null)
            {
                frameParts.GetHpGaugeParts().GetInfoText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                    t13.UnityUtil.ColorForColor32(frameParts.GetHpGaugeParts().GetInfoText().color)
                    , statusInfoParts.GetTimeFlucts(5)
                    , statusInfoParts.GetEndColor().a
                    , statusInfoParts.GetTimeRegulation()
                    , statusInfoParts.GetTimeRegulation()
                    );
            }
            frameParts.GetHpGaugeParts().GetGauge().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(frameParts.GetHpGaugeParts().GetGauge().color)
                , statusInfoParts.GetTimeFlucts(6)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeRegulation()
                , statusInfoParts.GetTimeRegulation()
                );

            return(StatusInfoPartsProcess.None);
        }
        else
        {
            BaseParts  baseParts  = statusInfoParts.GetBaseParts();
            FrameParts frameParts = statusInfoParts.GetFrameParts();

            baseParts.GetBaseSprite().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetBaseSprite().color)
                , statusInfoParts.GetTimeFlucts(0)
                , 255
                , statusInfoParts.GetTimeCounter().count()
                , statusInfoParts.GetTimeRegulation()
                );
            baseParts.GetHpLogoText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetHpLogoText().color)
                , statusInfoParts.GetTimeFlucts(1)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeCounter().count()
                , statusInfoParts.GetTimeRegulation()
                );
            baseParts.GetInfoNameEventText().GetText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(baseParts.GetInfoNameEventText().GetText().color)
                , statusInfoParts.GetTimeFlucts(2)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeCounter().count()
                , statusInfoParts.GetTimeRegulation()
                );

            frameParts.GetFrameSprite().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(frameParts.GetFrameSprite().color)
                , statusInfoParts.GetTimeFlucts(4)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeCounter().count()
                , statusInfoParts.GetTimeRegulation()
                );
            if (frameParts.GetHpGaugeParts().GetInfoText() != null)
            {
                frameParts.GetHpGaugeParts().GetInfoText().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                    t13.UnityUtil.ColorForColor32(frameParts.GetHpGaugeParts().GetInfoText().color)
                    , statusInfoParts.GetTimeFlucts(5)
                    , statusInfoParts.GetEndColor().a
                    , statusInfoParts.GetTimeCounter().count()
                    , statusInfoParts.GetTimeRegulation()
                    );
            }
            frameParts.GetHpGaugeParts().GetGauge().color = t13.UnityUtil.Color32InFluctUpdateAlpha(
                t13.UnityUtil.ColorForColor32(frameParts.GetHpGaugeParts().GetGauge().color)
                , statusInfoParts.GetTimeFlucts(6)
                , statusInfoParts.GetEndColor().a
                , statusInfoParts.GetTimeCounter().count()
                , statusInfoParts.GetTimeRegulation()
                );
        }

        return(mine.state_);
    }