public IHalfInningActions FillWalkActions(IHalfInningActions actions) { HalfInningActionsDto dto = Mapper.Map <HalfInningActionsDto>(actions); if (AreBasesLoaded(dto) == true) { dto.TotalRuns++; } else { if (dto.IsRunnerOnFirst && dto.IsRunnerOnSecond) { dto.IsRunnerOnFirst = false; dto.IsRunnerOnThird = true; } else if (dto.IsRunnerOnFirst) { dto.IsRunnerOnFirst = false; dto.IsRunnerOnSecond = true; } } dto.IsRunnerOnFirst = true; return(dto); }
public IHalfInningActions FillSacraficeHitActions(IHalfInningActions actions) { HalfInningActionsDto dto = Mapper.Map <HalfInningActionsDto>(actions); dto.TotalOuts++; if (dto.TotalOuts >= 3) { dto.AdvanceToNextHalfInning = true; } else { if (dto.IsRunnerOnThird) { dto.IsRunnerOnThird = false; dto.TotalRuns++; } if (dto.IsRunnerOnSecond) { dto.IsRunnerOnSecond = false; dto.IsRunnerOnThird = true; } if (dto.IsRunnerOnFirst) { dto.IsRunnerOnFirst = false; dto.IsRunnerOnSecond = true; } } return(dto); }
public IHalfInningActions FillDoublePlayActions(IHalfInningActions actions) { HalfInningActionsDto dto = Mapper.Map <HalfInningActionsDto>(actions); if (HasBaseRunner(dto) == true) { dto.TotalOuts += 2; } else { dto.TotalOuts++; } if (dto.TotalOuts >= 3) { dto.AdvanceToNextHalfInning = true; } else { if (dto.IsRunnerOnFirst) { dto.IsRunnerOnFirst = false; } else if (dto.IsRunnerOnSecond) { dto.IsRunnerOnSecond = false; } else if (dto.IsRunnerOnThird) { dto.IsRunnerOnThird = false; } } return(dto); }
public IHalfInningActions FillOutActions(IHalfInningActions actions) { HalfInningActionsDto dto = Mapper.Map <HalfInningActionsDto>(actions); dto.TotalOuts++; if (dto.TotalOuts >= 3) { dto.AdvanceToNextHalfInning = true; } return(dto); }
public IHalfInningActions FillHomeRunActions(IHalfInningActions actions) { HalfInningActionsDto dto = Mapper.Map <HalfInningActionsDto>(actions); if (dto.IsRunnerOnThird) { dto.IsRunnerOnThird = false; dto.TotalRuns++; } if (dto.IsRunnerOnSecond) { dto.IsRunnerOnSecond = false; dto.TotalRuns++; } if (dto.IsRunnerOnFirst) { dto.IsRunnerOnFirst = false; dto.TotalRuns++; } dto.TotalRuns++; return(dto); }