コード例 #1
0
ファイル: Form1.cs プロジェクト: ur92/ColorMatrix
        public Form1()
        {
            InitializeComponent();

            openFileDialog1.Filter = "Images|*.bmp;*.jpg;*.jpeg;*.png;*.tif;*.tiff;";
            openFileDialog1.FilterIndex = 1;

            saveFileDialog1.DefaultExt = ".tiff";
            saveFileDialog1.Filter = "Tiff|*.tiff";
            saveFileDialog1.FilterIndex = 1;
            saveFileDialog1.AddExtension = true;
            saveFileDialog1.OverwritePrompt = true;
            saveFileDialog1.FilterIndex = 1;

            //radio buttons defaults
            fillHeightMeasure = FillHeightMeasurment.Precents;
            fillColorType = FillColorType.Gradient;
            backgroundColorType = BackgroundColorType.Fix;
            logic = LogicCondition.XOR;

            //DEBUG
            sourceFileName = @"D:\Dropbox\Code\Developing\ColorMatrix\ColorMatrix-V.3\Client\colors.xlsx";
            colorMatrix = new ColorMatrixBL();
            colorMatrix.ImageCreated += colorMatrix_ImageCreated;
            UpdatePointsAndHeight();
        }
コード例 #2
0
        public LogicConditionInfo(LogicCondition logicCondition)
        {
            if (logicCondition == null)
            {
                throw new ArgumentNullException(nameof(logicCondition));
            }

            Type              = logicCondition.type;
            Inverse           = logicCondition.inverse;
            BoolValue         = logicCondition.boolValue;
            IntValue          = logicCondition.intValue;
            StringValue       = logicCondition.stringValue;
            ComparisonType    = logicCondition.comparisonType;
            DaytimeType       = logicCondition.daytimeType;
            DollOrientation   = logicCondition.dollOrientation;
            AffectionType     = logicCondition.affectionType;
            ResourceType      = logicCondition.resourceType;
            SettingDifficulty = logicCondition.settingDifficulty;
            DateType          = logicCondition.dateType;

            LocationDefinitionID = logicCondition.locationDefinition?.id ?? -1;
            GirlPairDefinitionID = logicCondition.girlPairDefinition?.id ?? -1;
            GirlDefinitionID     = logicCondition.girlDefinition?.id ?? -1;
            ItemDefinitionID     = logicCondition.itemDefinition?.id ?? -1;
        }
コード例 #3
0
 public ILogicCondition GetExpressionBuilder(LogicCondition condition)
 {
     return(condition switch
     {
         LogicCondition.And => new LogicConditionAnd(),
         LogicCondition.Or => new LogicConditionOr(),
         _ => throw new ArgumentOutOfRangeException(nameof(condition), condition, null)
     });
コード例 #4
0
        public void Match(Type expressionBuilderType, LogicCondition condition)
        {
            // Array

            // Act
            var _expressionBuilder = _strategy.GetExpressionBuilder(condition);

            // Assert
            Assert.IsInstanceOf(expressionBuilderType, _expressionBuilder);
        }
コード例 #5
0
        private void DoLogicCondition(Game game, Save save)
        {
            LogicCondition condition = (LogicCondition)save.CurrentLogic;

            //evaluate the condition
            bool result = bool.Parse(condition.Condition.Evaluate(game, save));

            //get the new list depending on result
            LogicList newList = result ? condition.TrueLogicList : condition.FalseLogicList;

            //set the prev and next logic to be the same as the condition's
            newList.Prev = condition.Prev;
            newList.Next = condition.GetNextLogic();

            save.CurrentLogic = newList;

            this.Overlord.Step(game, save);
        }
コード例 #6
0
        public LogicCondition ToLogicCondition(GameData gameData)
        {
            var newLogicCondition = new LogicCondition();

            newLogicCondition.type              = Type;
            newLogicCondition.inverse           = Inverse;
            newLogicCondition.boolValue         = BoolValue;
            newLogicCondition.intValue          = IntValue;
            newLogicCondition.stringValue       = StringValue;
            newLogicCondition.comparisonType    = ComparisonType;
            newLogicCondition.daytimeType       = DaytimeType;
            newLogicCondition.dollOrientation   = DollOrientation;
            newLogicCondition.affectionType     = AffectionType;
            newLogicCondition.resourceType      = ResourceType;
            newLogicCondition.settingDifficulty = SettingDifficulty;
            newLogicCondition.dateType          = DateType;

            newLogicCondition.locationDefinition = gameData.Locations.Get(LocationDefinitionID);
            newLogicCondition.itemDefinition     = gameData.Items.Get(ItemDefinitionID);
            newLogicCondition.girlPairDefinition = gameData.GirlPairs.Get(GirlPairDefinitionID);
            newLogicCondition.girlDefinition     = gameData.Girls.Get(GirlDefinitionID);

            return(newLogicCondition);
        }