protected virtual bool DoAreas(string rawParameters, params CommandParameter[] parameters) { TableGenerator <IArea> generator = new TableGenerator <IArea>("Areas"); generator.AddColumn("Name", 30, area => area.DisplayName, TableGenerator <IArea> .AlignLeftFunc); generator.AddColumn("Min", 5, area => area.MinLevel.ToString()); generator.AddColumn("Max", 5, area => area.MaxLevel.ToString()); generator.AddColumn("Builders", 15, area => area.Builders, TableGenerator <IArea> .AlignLeftFunc); generator.AddColumn("Credits", 40, area => area.Credits, TableGenerator <IArea> .AlignLeftFunc); StringBuilder sb = generator.Generate(DependencyContainer.Instance.GetInstance <IWorld>().Areas); Page(sb); return(true); }
protected virtual bool DoList(string rawParameters, params CommandParameter[] parameters) { if (!_avatarList.Any()) { Send("You don't have any avatar available. Use createavatar to create one."); return(true); } TableGenerator <CharacterData> generator = new TableGenerator <CharacterData>("Avatars"); generator.AddColumn("Name", 14, data => StringHelpers.UpperFirstLetter(data.Name)); generator.AddColumn("Level", 7, data => data.Level.ToString()); generator.AddColumn("Class", 12, data => DependencyContainer.Instance.GetInstance <IClassManager>()[data.Class]?.DisplayName ?? "none"); generator.AddColumn("Race", 12, data => DependencyContainer.Instance.GetInstance <IRaceManager>()[data.Race]?.DisplayName ?? "none"); generator.AddColumn("Location", 40, data => DependencyContainer.Instance.GetInstance <IWorld>().Rooms.FirstOrDefault(x => x.Blueprint.Id == data.RoomId)?.DisplayName ?? "In the void"); StringBuilder sb = generator.Generate(_avatarList); Send(sb); return(true); }