Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            //var gameClientConfiguration = new GameClientConfiguration()
            //{
            //    User = new Domain.Common.Model.Network.UserData() { Username = "******", Password = "******" },
            //    Screen = new Domain.Common.Model.Network.ScreenData() { ScreenWidth = 1024, ScreenHeight = 768 },
            //    ServerIp = "192.168.188.42",
            //    ServerPort = 8080,
            //    ServerPeerName = "asteroid",
            //    Background = new SpaceBackgroundElementsConfiguration()
            //    {
            //        AsteroidsCount = 300,
            //        DebrisFieldCount = 1500,
            //        StarsFieldCount = 2000
            //    }
            //};
            var yamler  = new YamlSerializerAdapter();
            var jsonler = new JsonSerializerAdapter();
            var msgler  = new MsgPackSerializerAdapter();
            //System.IO.File.WriteAllText("startup.yaml",yamler.Serialize(gameClientConfiguration));
            var gameConfig = System.IO.File.ReadAllText(args[0]);
            var gameClientConfiguration = yamler.DeserializeObject <GameClientConfiguration>(gameConfig);

            //return;

            Console.WriteLine(gameConfig);
            using (var game = new Game1(gameClientConfiguration))
                game.Run();
        }
Exemplo n.º 2
0
        private static void Main(string[] args)
        {
            var yamler  = new YamlSerializerAdapter();
            var jsonler = new JsonSerializerAdapter();
            var msgler  = new MsgPackSerializerAdapter();

            var config = yamler.DeserializeObject <GameServerConfiguration>(File.ReadAllText(args[0]));

            var world = new WorldGame(config);

            while (true)
            {
                world.Update(null);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var yamler  = new YamlSerializerAdapter();
            var jsonler = typeof(JsonSerializerAdapter);
            var msgler  = typeof(MsgPackSerializerAdapter);
            var config  = yamler.DeserializeObject <GameClientConfiguration>(File.ReadAllText(args[0]));

            var dataLayerWorker = new DataLayerWorker <
                PlayerSpaceship,
                EnemySpaceship,
                Item,
                Projectile,
                CharacterEntity,
                CharacterEntity,
                ImageData>(config);

            while (true)
            {
                dataLayerWorker.ProcessIncomingMessages();
            }
        }