Exemplo n.º 1
0
        public BuildingButton(Texture2D texture, Player p, SpriteBatch sBatch, int width, int height, int x, int y)
            : base(texture, sBatch, width, height, x, y)
        {
            buildingSelected = false;
            isSet = false;
            owner = p;

            Random r = new Random();

            buttonID = r.Next(System.DateTime.Now.Millisecond * 1000, System.DateTime.Now.Millisecond * 10000);
            System.Threading.Thread.Sleep(1000);

            while (p.containsMarkerID(buttonID))
            {
                buttonID = r.Next(System.DateTime.Now.Millisecond);
                System.Threading.Thread.Sleep(1000);
            }

            owner.addMarkerID(buttonID);
        }