コード例 #1
0
		/// <summary>
		/// Inicjalizuje obiekt gry.
		/// </summary>
		/// <param name="nations">List nacji</param>
		internal KingdomsClashNetGame(UserData.ClientLoader userData)
			: base(Configuration.Instance.WindowSize.Width, Configuration.Instance.WindowSize.Height, "Kingdoms Clash.NET",
			WindowFlags.Default & (Configuration.Instance.Fullscreen ? ~WindowFlags.Fullscreen : ~WindowFlags.None)
			& (Configuration.Instance.VSync ? ~WindowFlags.VSync : ~WindowFlags.None))
		{
			if (userData == null)
			{
				throw new System.ArgumentNullException("userData");
			}
			this.UserData = userData;
			this.Nations = userData.Nations;
		}
コード例 #2
0
		static void Main(string[] args)
		{
			System.AppDomain.CurrentDomain.UnhandledException += new System.UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

			UserData.ClientLoader loader = new UserData.ClientLoader(Defaults.RootDirectory, Defaults.UserData);
			
			loader.LoadConfiguration();
			loader.LoadNations();
			loader.LoadResources();

			using (var game = new KingdomsClashNetGame(loader))
			{
				game.Run();
			}
		}
コード例 #3
0
		internal Multiplayer(UserData.ClientLoader userData)
			: base("GameScreen", ClashEngine.NET.Interfaces.ScreenType.Fullscreen)
		{
			this.InGameHandlers.Add(GameMessageType.UnitQueued, this.UnitQueuedHandler);
			this.InGameHandlers.Add(GameMessageType.UnitCreated, this.UnitCreatedHandler);
			this.InGameHandlers.Add(GameMessageType.UnitDestroyed, this.UnitDestroyedHandler);
			this.InGameHandlers.Add(GameMessageType.ResourceAdded, this.ResourceAddedHandler);
			this.InGameHandlers.Add(GameMessageType.ResourceGathered, this.ResourceGatheredHandler);
			this.InGameHandlers.Add(GameMessageType.PlayerHurt, this.PlayerHurtHandler);
			this.InGameHandlers.Add(GameMessageType.GameEnded, this.GameEndedHandler);

			this.NonInGameHandlers.Add(GameMessageType.GameWillStartAfter, this.GameWillStartAfterHandler);
			this.NonInGameHandlers.Add(GameMessageType.GameStarted, this.GameStartedHandler);

			this.OthersHandlers.Add(GameMessageType.PlayerConnected, this.PlayerConnectedHandler);
			this.OthersHandlers.Add(GameMessageType.PlayerDisconnected, this.PlayerDisconnectedHandler);
			this.OthersHandlers.Add(GameMessageType.PlayerChangedNick, this.PlayerChangedNickHandler);
			this.OthersHandlers.Add(GameMessageType.PlayerChangedState, this.PlayerChangedStateHandler);

			this.UserData = userData;
		}