private string ArtTicketToClass(VisitorTicketType[] ticketList) { if (ticketList.Count() == 3) { return "ticket-any"; } string[] stringArray = { "", "", "" }; foreach (VisitorTicketType ticket in ticketList) { if (ticket == VisitorTicketType.investor) { stringArray[0] = "investor"; } if (ticket == VisitorTicketType.collector) { stringArray[1] = "collector"; } if (ticket == VisitorTicketType.vip) { stringArray[2] = "vip"; } } var result = "ticket"; foreach (string s in stringArray) { if (s != "") result += "-" + s; } return result; }
public static void MoveVisitorPlazaToGallery(this Player player, VisitorTicketType type) { var visitor = player.Game.Visitors.FirstOrDefault(v => v.Type == type && v.Location == GameVisitorLocation.Plaza); if(visitor != null) { visitor.UpdateVisitorLocation(GameVisitorLocation.Gallery, player.Color); } }
public GameArt(TemplateArt temp) { Type = temp.Type; Fame = temp.Fame; NumTickets = temp.NumTickets; FirstTicket = temp.FirstTicket; if(temp.NumTickets >= 2) SecondTicket = temp.SecondTicket; else SecondTicket = new VisitorTicketType[] { }; }
public static int GetPlayerTicketCountByType(this Player player, VisitorTicketType type) { switch (type) { case VisitorTicketType.collector: return player.CollectorTickets; case VisitorTicketType.investor: return player.InvestorTickets; case VisitorTicketType.vip: return player.VipTickets; default: return -1; } }
public static int GetAvailableTicketsByType(this Game game, VisitorTicketType type) { switch (type) { case VisitorTicketType.collector: return game.AvailableCollectorTickets; case VisitorTicketType.investor: return game.AvailableInvestorTickets; case VisitorTicketType.vip: return game.AvailableVipTickets; default: return -1; } }
public GameArt(TemplateArt temp) { Type = temp.Type; Fame = temp.Fame; NumTickets = temp.NumTickets; FirstTicket = temp.FirstTicket; if (temp.NumTickets >= 2) { SecondTicket = temp.SecondTicket; } else { SecondTicket = new VisitorTicketType[] { } }; }
public static int GetPlayerTicketCountByType(this Player player, VisitorTicketType type) { switch (type) { case VisitorTicketType.collector: return(player.CollectorTickets); case VisitorTicketType.investor: return(player.InvestorTickets); case VisitorTicketType.vip: return(player.VipTickets); default: return(-1); } }
public static int GetAvailableTicketsByType(this Game game, VisitorTicketType type) { switch (type) { case VisitorTicketType.collector: return(game.AvailableCollectorTickets); case VisitorTicketType.investor: return(game.AvailableInvestorTickets); case VisitorTicketType.vip: return(game.AvailableVipTickets); default: return(-1); } }
public static void GetTicket(this Player player, VisitorTicketType type) { switch(type) { case VisitorTicketType.collector: player.GetTicketCollector(); break; case VisitorTicketType.investor: player.GetTicketInvestor(); break; case VisitorTicketType.vip: player.GetTicketVip(); break; default: break; } }
public static void GetTicket(this Player player, VisitorTicketType type) { switch (type) { case VisitorTicketType.collector: player.GetTicketCollector(); break; case VisitorTicketType.investor: player.GetTicketInvestor(); break; case VisitorTicketType.vip: player.GetTicketVip(); break; default: break; } }
public static GameAction GetTicketAction(VisitorTicketType type) { GameAction action = new GameAction(); switch (type) { case VisitorTicketType.collector: action.State = GameActionState.GetTicketCollector; break; case VisitorTicketType.vip: action.State = GameActionState.GetTicketVip; break; case VisitorTicketType.investor: action.State = GameActionState.GetTicketInvestor; break; default: action = null; break; } return action; }
public static void RemoveTicketByType(this Game game, VisitorTicketType type) { if( game.GetAvailableTicketsByType(type) != 0 ) { switch (type) { case VisitorTicketType.collector: game.AvailableCollectorTickets--; break; case VisitorTicketType.investor: game.AvailableInvestorTickets--; break; case VisitorTicketType.vip: game.AvailableVipTickets--; break; default: break; } } }
public static void RemoveTicketByType(this Game game, VisitorTicketType type) { if (game.GetAvailableTicketsByType(type) != 0) { switch (type) { case VisitorTicketType.collector: game.AvailableCollectorTickets--; break; case VisitorTicketType.investor: game.AvailableInvestorTickets--; break; case VisitorTicketType.vip: game.AvailableVipTickets--; break; default: break; } } }
public static GameAction GetTicketAction(VisitorTicketType type) { GameAction action = new GameAction(); switch (type) { case VisitorTicketType.collector: action.State = GameActionState.GetTicketCollector; break; case VisitorTicketType.vip: action.State = GameActionState.GetTicketVip; break; case VisitorTicketType.investor: action.State = GameActionState.GetTicketInvestor; break; default: action = null; break; } return(action); }
public static int GetGalleryVisitorCountByType(this Player player, VisitorTicketType type) { return player.Game.Visitors.Where(v => v.PlayerGallery == player.Color && v.Location == GameVisitorLocation.Gallery && v.Type == type).Count(); }
public GameArt() { FirstTicket = new VisitorTicketType[] { }; SecondTicket = new VisitorTicketType[] { }; }
public static int GetPlazaVisitorCountByType(this Game game, VisitorTicketType type) { return game.Visitors.Where(v => v.Type == type && v.Location == GameVisitorLocation.Plaza).Count(); }