public SnakeGame(SimpleClient client) { _client = client; InitializeComponent(); _updateSnakeDelegate = new UpdateSnakeDelegate(UpdateSnake); _snake1 = Image.FromFile("C:/Users/nihar/OneDrive/Desktop/New folder/SimpleServer/SimpleServer/Images/BlueSnake1.bmp"); _snake2 = Image.FromFile("C:/Users/nihar/OneDrive/Desktop/New folder/SimpleServer/SimpleServer/Images/redSnake.bmp"); _apple = Image.FromFile("C:/Users/nihar/OneDrive/Desktop/New folder/SimpleServer/SimpleServer/Images/apple.bmp"); _rect1 = new Rectangle(20, 20, 70, 70); _rect2 = new Rectangle(500, 20, 70, 70); _appleRect = new Rectangle(); //_appleRect = new Rectangle(rnd.Next(20, 500), rnd.Next(20, 350), 20, 20); //drawFont.Dispose(); //drawBrush.Dispose(); //player.Dispose(); }
public static void Main() { SimpleClient _client = new SimpleClient(); if (_client.Connect(hostname, port)) { Console.WriteLine("Connected..."); try { _client.Run(); } catch (NotConnectedException e) { Console.WriteLine("Client not Connected"); } } else { Console.WriteLine("Failed to connect to: " + hostname + ":" + port); } Console.Read(); }
/// <summary> /// The main entry point for the application. /// </summary> //[STAThread] public static void Main(string[] args) { if (args == null || args.Length < 2) { Console.WriteLine( "Usage : SimpleClient <webserviceurl> <username> <password>" ); } cb = AppUtil.AppUtil.initialize("SimpleClient", args); SimpleClient sc = new SimpleClient(); try { // Connect to the Service cb.connect(); // Create the Service Managed Object Reference sc.CreateServiceRef("SimpleClient", args); // Retrieve Container contents for all Managed Entities and their names sc.GetContainerContents(); // Disconnect from the WebServcice cb.disConnect(); Console.WriteLine("Press enter to exit "); Console.Read(); } catch (SoapException se) { Console.WriteLine("Caught SoapException - " + " Actor : " + se.Actor + " Code : " + se.Code + " Detail XML : " + se.Detail.OuterXml); Console.Read(); } catch (Exception e) { Console.WriteLine("Caught Exception : " + " Name : " + e.GetType().Name + " Message : " + e.Message + " Trace : " + e.StackTrace); Console.Read(); } }
public Form1(SimpleClient client) { this.client = client; InitializeComponent(); updateChatWindowDelagate = new UpdateChatWindowDelagate(UpdateChatWindow); }
public TankGame(object client) { InitializeComponent(); Client = (SimpleClient)client; }
public ClientPacketHandler(SimpleClient client) { _client = client; _client.RegisterPacketHandler(EPacketType.ChatMessage, HandleChatMessagePacket); }
public GameWindow(SimpleClient client, bool isPlayerOne) { InitializeComponent(); this.client = client; this.isPlayerOne = isPlayerOne; string mainFolder = System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName) + @"\bomberman_images\"; string characterFolder = mainFolder + @"character\"; //Character images characterImages = new List <Bitmap>(); for (int i = 0; i < 2; i++) { string colourFolder = ""; switch (i) { case 0: colourFolder = @"white\"; break; case 1: colourFolder = @"red\"; break; } //Left characterImages.Add(new Bitmap(characterFolder + colourFolder + @"left_idle.png")); //0 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"left_step_left.png")); //1 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"left_step_right.png")); //2 //Right characterImages.Add(new Bitmap(characterFolder + colourFolder + @"right_idle.png")); //3 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"right_step_left.png")); //4 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"right_step_right.png")); //5 //Back characterImages.Add(new Bitmap(characterFolder + colourFolder + @"back_idle.png")); //6 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"back_step_left.png")); //7 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"back_step_right.png")); //8 //Front characterImages.Add(new Bitmap(characterFolder + colourFolder + @"front_idle.png")); //9 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"front_step_left.png")); //10 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"front_step_right.png")); //11 //Falling characterImages.Add(new Bitmap(characterFolder + colourFolder + @"falling_0.png")); //12 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"falling_1.png")); //13 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"falling_2.png")); //14 characterImages.Add(new Bitmap(characterFolder + colourFolder + @"falling_3.png")); //15 } //Bomb images bombImages = new List <Bitmap>(); bombImages.Add(new Bitmap(mainFolder + @"bomb_gray_large.png")); //0 bombImages.Add(new Bitmap(mainFolder + @"bomb_gray_normal.png")); //1 bombImages.Add(new Bitmap(mainFolder + @"bomb_gray_small.png")); //2 bombImages.Add(new Bitmap(mainFolder + @"bomb_red_large.png")); //3 bombImages.Add(new Bitmap(mainFolder + @"bomb_red_normal.png")); //4 bombImages.Add(new Bitmap(mainFolder + @"bomb_red_small.png")); //5 //Tile images tileImages = new List <Bitmap>(); tileImages.Add(new Bitmap(mainFolder + @"green_back.jpg")); //0 tileImages.Add(new Bitmap(mainFolder + @"brick.jpg")); //1 tileImages.Add(new Bitmap(mainFolder + @"block.jpg")); //2 tileImages.Add(new Bitmap(mainFolder + @"green_back_shadow.jpg")); //3 tileImages.Add(new Bitmap(mainFolder + @"gray_back.jpg")); //4 //Explosion tile images tileImages.Add(new Bitmap(mainFolder + @"explosion_centre_0.jpg")); //5 tileImages.Add(new Bitmap(mainFolder + @"explosion_centre_1.jpg")); //6 tileImages.Add(new Bitmap(mainFolder + @"explosion_centre_2.jpg")); //7 tileImages.Add(new Bitmap(mainFolder + @"explosion_centre_3.jpg")); //8 tileImages.Add(new Bitmap(mainFolder + @"explosion_centre_4.jpg")); //9 tileImages.Add(new Bitmap(mainFolder + @"explosion_vertical_centre_0.jpg")); //10 tileImages.Add(new Bitmap(mainFolder + @"explosion_vertical_centre_1.jpg")); //11 tileImages.Add(new Bitmap(mainFolder + @"explosion_vertical_centre_2.jpg")); //12 tileImages.Add(new Bitmap(mainFolder + @"explosion_vertical_centre_3.jpg")); //13 tileImages.Add(new Bitmap(mainFolder + @"explosion_vertical_centre_4.jpg")); //14 tileImages.Add(new Bitmap(mainFolder + @"explosion_horizontal_centre_0.jpg")); //15 tileImages.Add(new Bitmap(mainFolder + @"explosion_horizontal_centre_1.jpg")); //16 tileImages.Add(new Bitmap(mainFolder + @"explosion_horizontal_centre_2.jpg")); //17 tileImages.Add(new Bitmap(mainFolder + @"explosion_horizontal_centre_3.jpg")); //18 tileImages.Add(new Bitmap(mainFolder + @"explosion_horizontal_centre_3.jpg")); //19 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_left_0.jpg")); //20 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_left_1.jpg")); //21 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_left_2.jpg")); //22 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_left_3.jpg")); //23 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_left_4.jpg")); //24 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_right_0.jpg")); //25 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_right_1.jpg")); //26 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_right_2.jpg")); //27 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_right_3.jpg")); //28 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_right_4.jpg")); //29 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_top_0.jpg")); //30 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_top_1.jpg")); //31 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_top_2.jpg")); //32 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_top_3.jpg")); //33 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_top_4.jpg")); //34 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_bot_0.jpg")); //35 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_bot_1.jpg")); //36 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_bot_2.jpg")); //37 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_bot_3.jpg")); //38 tileImages.Add(new Bitmap(mainFolder + @"explosion_end_bot_4.jpg")); //39 //Brick fire tileImages.Add(new Bitmap(mainFolder + @"brick_fire_0.jpg")); //40 tileImages.Add(new Bitmap(mainFolder + @"brick_fire_1.jpg")); //41 tileImages.Add(new Bitmap(mainFolder + @"brick_fire_2.jpg")); //42 tileImages.Add(new Bitmap(mainFolder + @"brick_fire_3.jpg")); //43 tileImages.Add(new Bitmap(mainFolder + @"brick_fire_4.jpg")); //44 tileImages.Add(new Bitmap(mainFolder + @"brick_fire_5.jpg")); //45 //Powerups tileImages.Add(new Bitmap(mainFolder + @"powerup_fire.png")); //46 tileImages.Add(new Bitmap(mainFolder + @"powerup_fire_down.png")); //47 tileImages.Add(new Bitmap(mainFolder + @"powerup_bomb.png")); //48 tileImages.Add(new Bitmap(mainFolder + @"powerup_bomb_down.png")); //49 tileImages.Add(new Bitmap(mainFolder + @"powerup_skate.png")); //50 tileImages.Add(new Bitmap(mainFolder + @"powerup_geta.png")); //51 tileImages.Add(new Bitmap(mainFolder + @"powerup_red_bomb.png")); //52 }
static void Main(string[] args) { SimpleClient client = new SimpleClient(); }
/// <summary> /// The main entry point for the application. /// </summary> //[STAThread] public static void Main(string[] args){ if (args == null || args.Length < 2) { Console.WriteLine( "Usage : SimpleClient <webserviceurl> <username> <password>" ); } cb = AppUtil.AppUtil.initialize("SimpleClient", args); SimpleClient sc = new SimpleClient(); try { // Connect to the Service cb.connect(); // Create the Service Managed Object Reference sc.CreateServiceRef("SimpleClient", args); // Retrieve Container contents for all Managed Entities and their names sc.GetContainerContents(); // Disconnect from the WebServcice cb.disConnect(); Console.WriteLine("Press enter to exit "); Console.Read(); } catch (SoapException se) { Console.WriteLine("Caught SoapException - " + " Actor : " + se.Actor + " Code : " + se.Code + " Detail XML : " + se.Detail.OuterXml); Console.Read(); } catch (Exception e) { Console.WriteLine("Caught Exception : " + " Name : " + e.GetType().Name + " Message : " + e.Message + " Trace : " + e.StackTrace); Console.Read(); } }