public InvestPermissions GetPermissions(SocketGuildUser user) { InvestPermissions perms = GetInvestigator(user)?.Perms ?? InvestPermissions.None; if (IsMOGInvestigation) { if (user.IsAlexChester()) { perms |= InvestPermissions.Full; } if (user.IsMOG()) { perms |= InvestPermissions.Read; } } else { if (user.IsMOAInspector()) { perms |= InvestPermissions.Full; } if (user.IsMOA()) { perms |= InvestPermissions.Read; } } var invest = GetInvestigator(user); if (invest != null) { invest.Perms = perms; } return(perms); }
/*public int RakeBudget = 0; * public int BlackjakcBudget = 0; * * public override int ChipBudget { get => RakeBudget + BlackjakcBudget; set => throw new InvalidOperationException("Modify Rake/Blackjack budgets"); } */ public override Embed ToEmbed(InvestPermissions viewerPermissions) { EmbedBuilder builder = new EmbedBuilder() { Title = this.Name, Description = "Division Head: " + (this.DivisionHead.Nickname ?? this.DivisionHead.Username), Color = this.Color }; builder.AddField(x => { x.Name = "Budget"; x.Value = $"Actual: {ChipBudget}\nWeekly tracked: {WeeklyProfits}"; }); builder.AddField(x => { x.Name = "Employees"; string meh = "No employees"; if (this.Employees.Count > 0) { meh = ""; foreach (var e in this.Employees) { meh += $"{e.Nickname ?? e.Username}\n"; } } x.Value = meh; }); return(builder.Build()); }
public InvestMember AddInvestigator(SocketGuildUser user, InvestPermissions perms) { if (IsMOGInvestigation && user.IsMOGSupervisor()) { perms |= InvestPermissions.Full; } else if (!IsMOGInvestigation && user.IsMOAInspector()) { perms |= InvestPermissions.Full; } InvestMember newMem = new InvestMember(user, perms); user.AddRoleAsync(InvestigationRole); Investigators.Add(newMem); return(newMem); }
public abstract Embed ToEmbed(InvestPermissions viewerPermissions);