public AiRandomGameControl(IBoardModel boardModel, IFigureModel figureModel, IGameMaster gameMaster, IGameSwitcherTurn gameSwitcherTurn) { BoardModel = boardModel.CheckNull(); FigureModel = figureModel.CheckNull(); GameMaster = gameMaster.CheckNull(); GameSwitcherTurn = gameSwitcherTurn.CheckNull(); }
/// <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)); }
/// <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); }
public FigureCreator(IFigureModel figureModel) { FigureModel = figureModel.CheckNull(); }
public AreaResult GetArea(IFigureModel figureModel) { var result = new AreaResult(); return(result); }
private void Construct(IFigureModel figureModel) { _victimFigureDef.CheckNull(); FigureModel = figureModel.CheckNull(); }
public FigureController(IFigureModel figureModel) { FigureModel = figureModel.CheckNull(); }
private void Construct(IFigureModel figureModel) { FigureModel = figureModel.CheckNull(); }