This bot runs during the live twitch.tv/CodeRushed stream and its primary function is to allow people in the chat room to control Mark's electronic co-host, during the show.
Phrases Mr. Announcer Bot Can Say
Mr. Announcer Bot has a vocabulary of over 100 phrases that include pre-rendered animations synched up to the words. To get Mr. Announcer Bot to say something, simply type the "!" symbol into the chat room followed by the shortcut command for the phrase.
For example, to get Mr. Announcer Bot to say "Excellent!", send the text "!ex" to the chat window.
Levels
For the purposes of determining what you can say, Mr. Announcer Bot tracks viewer "levels". Levels are determined by past contributions, total time spent in the chat room (across all the episodes), and whether you are following/subscribing to the channel or not. It's a lot like one of those dungeon adventuring games. A level-72 wizard can smite you with a side-eye glance, while a level-0 wizard may be stuck fumbling with the spell casting book just to cast magic missiles.
Here is more about level qualifications and what you can say based on your level:
Level 0
Anyone in the chat room who is not yet following the CodeRushed channel is a Level 0 botcaster. Level 0 botcasters can say any of these phrases:
Shortcut
Scene
Category
cr
CodeRush!*
Branding
dx
DevExpress!
Branding
ex
Excellent!
Good
mark
Mark->*
Alert
Level 1
Want to jump-start your levels in the chat room? Follow us on Twitch at:
Of course, you cannot always use the ternary and readability is still not the best. To do a general purpose solution, pull the block out into a function:
Your LINQ is much cleaner and you now have a utility function that you will probably find uses for elsewhere. If not, you can always make it a nested function in the current method.
Personally, I think all LINQ code should be like this. Single line per function call when using many and simple checks or method calls per function. Makes it really easy to see the flow and to rearrange, add, remove, comment out individual pieces, etc...
Hello there!
I watched the last stream and scribbled along the alternative non-licensed(aka free for use) version of the cog day-night cycle image. I saved it as a png but can reexport it into different layers or even make an svg-overhaul if needed. The picture is made in procreate and as such a psd is available too.
Should I create a pull request or is it ok as it is(it should be a transparent png, but i dunno if github actually messes with it)?
Best regards,
Oste
Here is an example of what I was suggesting a few streams ago. To be clear, I'm not saying it's "better". Just the way I usually do it because "I" think it's easier to read and maintain. Let me know what you think.
Wil
Original:
static WeaponProperties GetWeaponProperties(WeaponDto weaponDto)
{
WeaponProperties result = WeaponProperties.None;
if (MathUtils.IsChecked(weaponDto.Ammo))
result |= WeaponProperties.Ammunition;
if (MathUtils.IsChecked(weaponDto.Finesse))
result |= WeaponProperties.Finesse;
if (MathUtils.IsChecked(weaponDto.Heavy))
result |= WeaponProperties.Heavy;
if (MathUtils.IsChecked(weaponDto.Light))
result |= WeaponProperties.Light;
if (MathUtils.IsChecked(weaponDto.Martial))
result |= WeaponProperties.Martial;
if (MathUtils.IsChecked(weaponDto.Melee))
result |= WeaponProperties.Melee;
if (MathUtils.IsChecked(weaponDto.Ranged))
result |= WeaponProperties.Ranged;
if (MathUtils.IsChecked(weaponDto.Reach))
result |= WeaponProperties.Reach;
if (MathUtils.IsChecked(weaponDto.Special))
result |= WeaponProperties.Special;
if (MathUtils.IsChecked(weaponDto.Thrown))
result |= WeaponProperties.Thrown;
if (MathUtils.IsChecked(weaponDto.TwoHanded))
result |= WeaponProperties.TwoHanded;
if (MathUtils.IsChecked(weaponDto.Versatile))
result |= WeaponProperties.Versatile;
return result;
}
You could make the IncludeIf method global and generic as well. There would need to be a modification since you have to "change" the enum to a number to "or" it in a generic method. I don't think the global approach is worth the expense though (you have to box/unbox or something similar - like use IConvertible).