示例#1
0
        //------------------------------------------------------------------------------------
        public Game()
        {
            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 800;
            graphics.PreferredBackBufferWidth = 600;
            graphics.ApplyChanges();

            Settings.Viewport = new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height);

            IsMouseVisible = true;

            Content.RootDirectory = Settings.Content;

            // initialize accounts
            if (Directory.Exists(Settings.Accounts))
            {
                if (Account.DefaultAccountExist())
                {
                    currentAccount = new Account();
                }
                else
                {
                    Account.CreateDefaultAccount(ref currentAccount);
                }
            }
            else
            {
                Directory.CreateDirectory(Settings.Accounts);
                Account.CreateDefaultAccount(ref currentAccount);
            }
        }
示例#2
0
 public static void CreateDefaultAccount(ref Account currentAccount)
 {
     File.Create(file);
     currentAccount = new Account();
 }