예제 #1
0
 public AiRandomGameControl(IBoardModel boardModel,
                            IFigureModel figureModel,
                            IGameMaster gameMaster,
                            IGameSwitcherTurn gameSwitcherTurn)
 {
     BoardModel       = boardModel.CheckNull();
     FigureModel      = figureModel.CheckNull();
     GameMaster       = gameMaster.CheckNull();
     GameSwitcherTurn = gameSwitcherTurn.CheckNull();
 }
예제 #2
0
        /// <summary>
        /// Return Circle area
        /// </summary>
        /// <returns>Circle area</returns>
        public AreaResult GetArea(IFigureModel figureModel)
        {
            if (figureModel is CircleModel == false)
            {
                return(new AreaResult
                {
                    Error = new AreaGetterException("Другая модель.")
                });
            }

            var circle = figureModel as CircleModel;

            return(GetArea(circle.Radius));
        }
예제 #3
0
        /// <summary>
        /// Returns triangle area
        /// </summary>
        /// <returns>Triangle area</returns>
        public AreaResult GetArea(IFigureModel figureModel)
        {
            var result = new AreaResult();

            try
            {
                if (figureModel is TriangleModel == false)
                {
                    throw new AreaGetterException("Другая модель.");
                }

                var triangle = figureModel as TriangleModel;
                CheckTriangle(triangle.FirstLength, triangle.SecondLength, triangle.ThirdLength);
                result.SetArea(GetCurrentArea(triangle.FirstLength, triangle.SecondLength, triangle.ThirdLength));
            }
            catch (AreaGetterException ex)
            {
                result.Error = ex;
            }

            return(result);
        }
예제 #4
0
 public FigureCreator(IFigureModel figureModel)
 {
     FigureModel = figureModel.CheckNull();
 }
예제 #5
0
        public AreaResult GetArea(IFigureModel figureModel)
        {
            var result = new AreaResult();

            return(result);
        }
예제 #6
0
        private void Construct(IFigureModel figureModel)
        {
            _victimFigureDef.CheckNull();

            FigureModel = figureModel.CheckNull();
        }
예제 #7
0
 public FigureController(IFigureModel figureModel)
 {
     FigureModel = figureModel.CheckNull();
 }
 private void Construct(IFigureModel figureModel)
 {
     FigureModel = figureModel.CheckNull();
 }