Architecture Overview

This page will give you a general overview over the general concepts of XNAchievement. If you like a more practical introduction view the Getting Started page. This is a class diagram with (currently) all classes: (We will discuss the section below)
XNAchievement Classes.png

Achievement Manager (green)

This manager helps you to keep track of all your achievements. But it's completely optional, you don't have to use it! Add achievements using .Add() and retrieve them using ["name"] or .GetByName("name").

The achievement manager mostly forwards a lot of functions: .LoadContent() will reach all registered achievements and the AnyUnlocked and AnyNotification events will be raised when any of the registered achievement raises this event.

Achievements (red)

This are the achievement types. Each type is for a own type of achievement. Have a look at the list of achievements for more information.

There a a few properties common to all achievements that might need additional explanation (all of them have IntelliSense comments)

Texture, LockedTexture and UnlockedTexture

When the constructor was called with a texture name and .LoadContent() was called these will hold a Texture2D. Texture switched base on IsLocked and therefore has always the correct image.

Description, LockedDescription and UnlockedDescription

Same as above. Assign values to the two *Descriptions and Description will always have the correct value based on IsLocked.

Extension points (blue)

This are the points for you to drop in custom functionality:

INotificationHandler (light blue)

These show a notification (toast, popup, ...) if a Notification event occurs. See Getting Started for more information. The DebugNotificationHandler writes notifications to the Debug stream.

IAchievementFormatters (purple)

They turn a Achievement instance into string. See Getting Started for more information. We have a list of the build-in Achievement Formatters

Events (yellow)

This are the EventArgs classes for (Any)Notification, Progressing and AnyUnlocked events.

Last edited Jul 6, 2012 at 4:17 PM by simsmaster, version 4


No comments yet.