2. Hi!
• My name is Dmitri
• Quant finance
• Developer Evangelist @ JetBrains (2010-…)
• Visiting Researcher @
University of Southampton (2002-…)
• MVP Visual C# (2009-…)
3. Calculation of 𝜋𝜋
• Generate lots of points in
square
• Area of circle
𝜋𝜋𝑟𝑟2
• Area of square
4𝑟𝑟2
• ∴ 𝜋𝜋 = 4
𝑆𝑆𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐
𝑆𝑆𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠
• Area ~ number of points
r
10. HearthStone
• ~400 differentcards
• Player pick a deck of 30
• Each card has stationary and transient behaviors
• May affect 0, 1 or several other cards
11. Rules
• Stored in an XML file
• Parsed via boost::regex
• Result in creation of std::function objects
12. Everything affects everything
• This card gives bonus to other card
• When card enters play, …
• When card leaves play, …
• This interaction method does not map well to OOP
13. Properties
• Properties are built-in in C#, not available in C++ or Java
• __declspec(property) compiler extension
• Supported on at least Intel and MSVC compilers
• A person structure keeps the person’s age
• Age (read/write)
• Only people older than 16 can vote
• CanVote (readonly)
• This is a derivative property (at runtime you need an std::function)
14. Change notifications
• We want to be informed when properties change
• Use boost::signals
• Let’s borrow .NET ideology!
15. Event Bus
• Global communication pipeline
• Entity signs up when enters game, disconnects on exit
• Also uses signal/slot paradigm
16. Realtime Analysis
• The game uses Unity
• Decompiled .NET libs
• Reverse-engineerProtocol Buffer definitions
• …
• PROFIT!!!