Programming Techniques

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Some general useful programming techniques.

Contents

Data structures

Design patterns

Programming patterns

Behavioral patterns

  • Observer When an object changes state, other objects are notified
  • State Changing object behavior depending on the state of an object
  • Strategy Supplying different interchangeable variants of an algorithm in a class
  • Template method Supplying an algorithm in which sub-classes can redefine certain steps without changing the overall algorithm
  • Visitor Separating operations on an object from the object itself in an extendable way. The basis for "double dispatch".

Creational patterns

  • Singleton Implementing a class that has exactly one instance and a global point of access
  • Abstract Factory Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
  • Builder Implementing a class that builds parts of a complex object.

Structural patterns

  • Composite Combining several objects into an object that has the same behavior as its parts

Usability patterns

  • Magnetism Making it easier and less frustrating to do precise targeting
  • Shield Preventing that a critical action is performed by accident
  • Context A single user command will perform the action appropriate to the context in which the command was issued

Error handling

I/O

Math Gems

Miscellaneous

Programming Techniques