public DreadApparitions_Tests() { Bringer spirit = new Bringer(); board = Board.BuildBoardA(); GameState gs = new GameState(spirit, board); ctx = spirit.BindMyPower(gs).Target(board[5]); }
public IActionResult OnPost() { object o = null; RouteData.Values.TryGetValue("id", out o); int i = int.Parse((string)o); UserType = (UserTypes)i; switch (UserType) { case UserTypes.Buyer: //UserType = Buyer Buyer buyerTemp = null; foreach (Buyer buy in _buyers.ReadAll()) { if (Username == buy.Username) { buyerTemp = buy; } } if (buyerTemp != null) { takenUsername(); } else { return(register(UserTypes.Buyer)); } return(Page()); case UserTypes.Bringer: //UserType = Bringer Bringer bringerTemp = null; foreach (Bringer bri in _bringers.ReadAll()) { if (Username == bri.Username) { bringerTemp = bri; } } if (bringerTemp != null) { takenUsername(); } else { return(register(UserTypes.Bringer)); } return(Page()); case UserTypes.Store: //UserType = Store Store storeTemp = null; foreach (Store sto in _stores.ReadAll()) { if (Username == sto.Username) { storeTemp = sto; } } if (storeTemp != null) { takenUsername(); } else { return(register(UserTypes.Store)); } return(Page()); default: //This should not happen, please throw an exception here return(Page()); } }
public BringerCtx(Bringer bringer, GameState gs) : base(bringer, gs, Cause.MyPowers) { }