Esempio n. 1
0
        public virtual void Create(Transform spawnLocation, uint id = 0)
        {
            this.id              = id;
            this._name           = "Player" + (id + 1).ToString().PadLeft(2, '0');
            this.gameObject.name = this._name;
            this._turnEnded      = false;

            this.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);

            this._spawnLocation = spawnLocation;

            this._castle = StructurePoolManager.instance.GetStartCastle(this);

            GameObject ui = GameObject.Instantiate(AssetManager.instance.playerUI, this.transform);

            ui.name                      = UIValues.Player.PLAYERUI;
            this._uiComponent            = this.gameObject.AddComponent <PlayerUI>();
            this._uiComponent.controller = this;
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Setup up logging with log4net
            XmlConfigurator.Configure();

            string ep = Properties.Settings.Default.RegistryEndPoint;
            if (args.Length > 0)
            {
                if (args[0].ToLower().Contains("local"))
                {
                    ep = Properties.Settings.Default.LocalRegistryEndPoint;
                }
            }
            Player player = new Player()
            {
                IdentityInfo = new IdentityInfo()
                {
                    LastName = Properties.Settings.Default.LastName,
                    FirstName = Properties.Settings.Default.FirstName,
                    ANumber = Properties.Settings.Default.ANumber,
                    Alias = Properties.Settings.Default.Alias
                },
                ProcessLabel = Properties.Settings.Default.ProcessLabel,
                RegistryEndPoint = new PublicEndPoint()
                {
                    HostAndPort = ep
                }
            };
            
            logger.Debug("Starting player");
            Thread playerThread = new Thread(new ThreadStart(player.Start));
            playerThread.Start();

            PlayerUI ui = new PlayerUI(player);
            Application.Run(ui);

            player.Stop();
            playerThread.Join();
        }