public ActionResult SkipStartUpPhase() { var gameManager = RiskContext.GetGame(); gameManager.DoStartupPhase(); return(View("Index", CreateBoard(gameManager))); }
public ActionResult NextTurn() { var gameManager = RiskContext.GetGame(); gameManager.DoNextTurn(); return(View("Index", CreateBoard(gameManager))); }
public ActionResult Index() { var board = new Board { Countries = RiskContext.GetGame().Countries }; return(View(board)); }
public MainViewModel() { ViewLoaded += OnViewLoaded; UserSaving += OnUserSaving; RiskSaving += OnRiskSaving; StrategySaving += OnStrategySaving; Client = SingletonClient.GetInstance(this).Client; RiskContext = new RiskContext(); StrategyContext = new StrategyContext(); }
public ActionResult EndGame() { var gameManager = RiskContext.GetGame(); do { gameManager.DoNextTurn(); } while (!gameManager.GameEnded); return(View("Index", CreateBoard(RiskContext.GetGame()))); }
private Board CreateBoard(GameManager gameManager) { return(new Board { Countries = gameManager.Countries, Actions = gameManager.Actions, NextPhase = gameManager.CurrentPhase, ActivePlayer = gameManager.CurrentPlayer, Players = gameManager.Players.ToList(), GameEnded = gameManager.GameEnded, TimesWonByPlayers = RiskContext.GetStats().TimesWonByPlayer, Turn = gameManager.Turn, LastPhase = gameManager.LastPhase, LastPlayer = gameManager.LastPhase == EPhase.Move ? gameManager.LastPlayer : gameManager.CurrentPlayer }); }
/* * public void CustomAUMTableColumnDef_Create(CustomAUMTableColumnDefViewModel valTableColumnDef) * { * var entity = new ValidationTableColumnDef(); * * entity.TableName = valTableColumnDef.TableName; * entity.ColumnName = valTableColumnDef.ColumnName; * * parameters.ValidationTableColumnDef.Add(entity); * parameters.SaveChanges(); * * valTableColumnDef.Id = entity.Id; * } * * public void CustomAUMMapping_Create(CustomAUMMappingViewModel CustomAUMMapping) * { * var entity = new CustomAUMMapping(); * * entity.CustomAUMTableColumnDefId = CustomAUMMapping.ValidationTableColumnDefId; * entity.ValidationFormTypeId = CustomAUMMapping.ValidationFormTypeId; * entity.RelatedQuestions = CustomAUMMapping.RelatedQuestions; * entity.Mappings = CustomAUMMapping.Mappings; * entity.ViewOrder = CustomAUMMapping.ViewOrder; * * parameters.CustomAUMMapping.Add(entity); * parameters.SaveChanges(); * * CustomAUMMapping.Id = entity.Id; * } * * public void ValidationEnumeration_Create(ValidationEnumerationViewModel ValidationEnumeration) * { * var entity = new ValidationEnumeration(); * * entity.Id = ValidationEnumeration.Id; * entity.ValidationEnumerationId = ValidationEnumeration.ValidationEnumerationId; * entity.Value = ValidationEnumeration.Value; * * parameters.ValidationEnumeration.Add(entity); * parameters.SaveChanges(); * } * * public void ValidationRulesErrorMessage_Create(ValidationRulesErrorMessageViewModel validationRulesErrorMessage) * { * var entity = new ValidationRulesErrorMessages(); * * entity.ColumnID = validationRulesErrorMessage.ColumnID; * entity.Message = validationRulesErrorMessage.Message; * entity.ValidationFormTypeIds = validationRulesErrorMessage.ValidationFormTypeIds; * * parameters.ValidationRulesErrorMessages.Add(entity); * parameters.SaveChanges(); * * validationRulesErrorMessage.Id = entity.Id; * } * * public void ValidationRule_Create(ValidationRuleViewModel validationRule) * { * var entity = new ValidationRules(); * * entity.CustomAUMTableColumnDefId = validationRule.CustomAUMTableColumnDefId; * entity.OperandColumn = validationRule.OperandColumn; * entity.ValidationOperator = validationRule.ValidationOperator; * entity.OperandValue = validationRule.OperandValue; * entity.ValidationStep = validationRule.ValidationStep; * entity.ValidationFormTypeIds = validationRule.ValidationFormTypeIds; * * parameters.ValidationRules.Add(entity); * parameters.SaveChanges(); * * validationRule.Id = entity.Id; * }*/ #endregion #region Read public IEnumerable <RiskReportDataTableColumnDefViewModel> ValidationTableColumnDef_Read() { var riskCtx = new RiskContext(); var riskReportDataColumnDefs = riskCtx.CustomAUMMapping.Select(riskReportDataColumnDef => new RiskReportDataTableColumnDefViewModel { Id = riskReportDataColumnDef.Id, Client = riskReportDataColumnDef.Client, Portfolio = riskReportDataColumnDef.Portfolio, AUM = riskReportDataColumnDef.AUM, EffectiveDate = riskReportDataColumnDef.EffectiveDate, IsStatic = riskReportDataColumnDef.IsStatic, sysDate = riskReportDataColumnDef.sysDate, ModifiedBy = riskReportDataColumnDef.ModifiedBy, }); return(riskReportDataColumnDefs); }
public CustomAUMService(RiskContext parameters) { this.parameters = parameters; }
public ThreatController(RiskContext context) { _context = context; }
public RiskController(RiskContext context) { _context = context; }
public SeedUtilities(RiskContext context) { _context = context; }
public SettledBetRepository(RiskContext context) { _context = context; }
public CustomerRepository(RiskContext context) { _context = context; }
public DataMigration(RiskContext context) { _context = context; }
public ActionResult NewGame() { RiskContext.ResetGame(); return(View("Index", CreateBoard(RiskContext.GetGame()))); }