xna debug terminal

18
Created By: Kevin Cherry

Upload: alanna

Post on 18-Mar-2016

47 views

Category:

Documents


3 download

DESCRIPTION

XNA DEBUG TERMINAL. Created By: Kevin Cherry. What is XNA Debug Terminal?. A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods. How Does it Work?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: XNA DEBUG TERMINAL

Created By:Kevin Cherry

Page 2: XNA DEBUG TERMINAL

A library that creates a display to run on top A library that creates a display to run on top of your game allowing you to retrieve/set of your game allowing you to retrieve/set values and invoke methods.values and invoke methods.

Page 3: XNA DEBUG TERMINAL

To understand how this is possible, we need to To understand how this is possible, we need to examine some basic and .Net specific conceptsexamine some basic and .Net specific concepts

Page 4: XNA DEBUG TERMINAL

Interpreted languages evaluate source code Interpreted languages evaluate source code at runtimeat runtime Code is not compiled but rather parsed and Code is not compiled but rather parsed and

evaluated as needed.evaluated as needed. Examples: JavaScript, PHP, Python, RubyExamples: JavaScript, PHP, Python, Ruby

Compiled languages compile to assembly or Compiled languages compile to assembly or special/proprietary intermediate language special/proprietary intermediate language losing type information in the process, losing type information in the process, making arbitrary code execution at runtime making arbitrary code execution at runtime impossible.impossible. Examples: C#, C++, Java, VBExamples: C#, C++, Java, VB

Page 5: XNA DEBUG TERMINAL

Why it is possible to interpret strings containing Why it is possible to interpret strings containing code at runtime with a .Net languagecode at runtime with a .Net language .Net converts code into Microsoft Intermediate .Net converts code into Microsoft Intermediate

Language and a metadata file. The metadata Language and a metadata file. The metadata file contains all the information obtained from file contains all the information obtained from parsing the source types and MSIL contains parsing the source types and MSIL contains the instructions for execution. Querying this the instructions for execution. Querying this metadata we can obtain links to type metadata we can obtain links to type members.members.

Page 6: XNA DEBUG TERMINAL
Page 7: XNA DEBUG TERMINAL

To query this metadata file, we use reflections. To query this metadata file, we use reflections. This part of the .Net framework provides This part of the .Net framework provides information on the specified object’s type information on the specified object’s type which can be used to retrieve fields/properties which can be used to retrieve fields/properties or invoke methods.or invoke methods.

Page 8: XNA DEBUG TERMINAL

It converts your expression into subexpressions, It converts your expression into subexpressions, then parses and evaluates them using reflections.then parses and evaluates them using reflections.

Page 9: XNA DEBUG TERMINAL
Page 10: XNA DEBUG TERMINAL
Page 11: XNA DEBUG TERMINAL

Pressing custom set key shows/hides Pressing custom set key shows/hides displaydisplay

Page 12: XNA DEBUG TERMINAL

Invoke method for restoring health of Invoke method for restoring health of playerplayer

Page 13: XNA DEBUG TERMINAL

CastingCasting EnumsEnums IdentifiersIdentifiers LiteralsLiterals MethodsMethods NewNew Object chainsObject chains TypesTypes

Page 14: XNA DEBUG TERMINAL

Anonymous Types/FunctionsAnonymous Types/Functions Array indexing or initializationArray indexing or initialization ArithmeticArithmetic Collection initializationCollection initialization Conditional logicConditional logic GenericsGenerics Keywords:Keywords:

as, base, default (e.g. default(int)), fixed, is, out, as, base, default (e.g. default(int)), fixed, is, out, ref, sizeof, stackalloc, this, throw, typeof, ref, sizeof, stackalloc, this, throw, typeof, unchecked, unsafeunchecked, unsafe

Lambda FunctionsLambda Functions LINQLINQ Logic Operators (&, |, ^, &&, ||)Logic Operators (&, |, ^, &&, ||) Property indexersProperty indexers

Page 15: XNA DEBUG TERMINAL

Bugs in expression parsingBugs in expression parsing Common/Frequently used C# expressionsCommon/Frequently used C# expressions Bugs elsewhereBugs elsewhere Common/Frequently used C# keywordsCommon/Frequently used C# keywords New Terminal commandsNew Terminal commands Terminal UI improvementsTerminal UI improvements Speed optimizationsSpeed optimizations Other improvementsOther improvements

Page 16: XNA DEBUG TERMINAL

Email me at: [email protected] Email me at: [email protected] with subject “with subject “XNA Debug Terminal Source Code" XNA Debug Terminal Source Code" to obtain to obtain

the source codethe source code Look over code and decide on a single task to Look over code and decide on a single task to

undertakeundertake Email me details of the task (what it is and about Email me details of the task (what it is and about

how long it will take you)how long it will take you) Email back the original source code with all of your Email back the original source code with all of your

changes when donechanges when done All contributors will get name in Authors file and All contributors will get name in Authors file and

Getting Involved, News, and Download webpagesGetting Involved, News, and Download webpages

Page 17: XNA DEBUG TERMINAL

Document all types, fields, properties, and methods Document all types, fields, properties, and methods you add using the "///" xml documentationyou add using the "///" xml documentation

Add test cases to the test project that cover your Add test cases to the test project that cover your newly added functionality and ensure that each one newly added functionality and ensure that each one passes. All previous test cases must pass as wellpasses. All previous test cases must pass as well

Try to follow the coding convention used by the Try to follow the coding convention used by the existing codeexisting code

Only change existing code when it concerns your Only change existing code when it concerns your single tasksingle task

Page 18: XNA DEBUG TERMINAL

http://www.protohacks.net/xna_debug_terminalhttp://www.protohacks.net/xna_debug_terminal