Click here to Skip to main content
11,584,622 members (72,587 online)
Click here to Skip to main content
Add your own
alternative version

Game Attack Combos : WPF Hybrid Smart Client for Combo Calculations

, 23 May 2009 CPOL 47.6K 2.9K 47
A WPF hybrid smart client for calculating attack combos in the Prince of Persia game.
GameAttackCombos_Src.zip
ComboServices
App_Data
ComboPackagesService.svc
GameAttackCombos.snk
Properties
GameAttackCombos.mdf
GameAttackCombos_log.LDF
Packages
PrinceOfPersia2008.gcp
PrinceOfPersia2010.gcp
PackageComboFiles
Properties
ServiceData
GameAttackCombosModel.edmx
Properties
GameAttackCombos.snk
Assets
Button Icons.design
Game Attack Combos Icon.design
Game Attack Combos Icon.ico
Prince of Persia 2008
Prince of Persia 2010
PrinceOfPersia2010Background.png
PrinceOfPersia2010Icon.png
PrinceOfPersia2008Background.png
PrinceOfPersia2008Icon.png
ComboClient
Game Attack Combos Icon.ico
Properties
Resources
Service References
Supporting
Themes
ComboServices
ComboPackagesService.disco
ComboPackagesService.wsdl
ComboPackagesService1.wsdl
configuration.svcinfo
configuration91.svcinfo
Reference.svcmap
app.manifest
ComboLogic
Properties
GameAttackCombos_Standalone.zip
Packages
PrinceOfPersia2008.gcp
PrinceOfPersia2010.gcp
Resources
PresentationFramework.Aero.dll
GameAttackCombos.exe
GameAttackCombos.Logic.dll
using System.ComponentModel;

namespace GG.GameAttackCombos.Logic {

	/// <summary>
	/// Represents a command used to form an attack combo.
	/// </summary>
	public class Command : INotifyPropertyChanged {

		// Property backing fields.
		private Button _mappedButton;


		#region Properties

		/// <summary>
		/// The ID for this command, used to uniquely identify it.
		/// </summary>
		public string Id { get; private set; }

		/// <summary>
		/// The name of this command.
		/// </summary>
		public string Name { get; private set; }

		/// <summary>
		/// The button this command is mapped to currently.
		/// </summary>
		public Button MappedButton {
			get { return _mappedButton; }
			set {
				if (_mappedButton != value) {
					_mappedButton = value;
					NotifyPropertyChanged("MappedButton");
				}
			}
		}

		#endregion


		/// <summary>
		/// Initializes an instance of Command.
		/// </summary>
		public Command() { }

		/// <summary>
		/// Initializes an instance of Command.
		/// </summary>
		/// <param name="id">The ID of this command.</param>
		/// <param name="name">The name of this command.</param>
		public Command(string id, string name) 
			: this() {
			Id = id;
			Name = name;
		}

		/// <summary>
		/// Overriden to include the command's name.
		/// </summary>
		/// <returns></returns>
		public override string ToString() {
			return string.Format("Command: {0}", Name);
		}


		/// <summary>
		/// Raises the PropertyChanged event for the specified property.
		/// </summary>
		/// <param name="propertyName">The name of the property that changed.</param>
		protected virtual void NotifyPropertyChanged(string propertyName) {
			PropertyChangedEventHandler Handler = PropertyChanged;
			if (Handler != null) {
				Handler(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		#region INotifyPropertyChanged Members

		public event PropertyChangedEventHandler PropertyChanged;

		#endregion
		
	}

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Matt Sollars
Web Developer
United States United States
I began programming on my Commodore 64 at around the age of 12. After migrating to DOS and then Windows, I decided to take on the Web. Several languages and platforms later, I have settled in with .NET nicely. I am currently the owner of a software consulting company and lead application developer for a learning-based technology consultation company.

The love of a finished application is usually at war with the desire to improve it as soon as it's released (they're never really finished).

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150707.1 | Last Updated 23 May 2009
Article Copyright 2009 by Matt Sollars
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid