コード例 #1
0
ファイル: Main.cs プロジェクト: sapeornis/Realm2
        /// <summary>
        /// Constructs the Main class.
        /// </summary>
        /// <param name="_mainWindow">Instance of the MainWindow.</param>
        /// <param name="bpwindow">Instance of the BackpackWindow</param>
        /// <param name="crcwindow">Instance of the ClassRaceChoiceWindow</param>
        /// <param name="swindow">Instance of the StatWindow</param>
        public Main(MainWindow _mainWindow, BackpackWindow bpwindow, ClassRaceChoiceWindow crcwindow, StatWindow swindow)
        {
            //save the windows
            mainWindow = _mainWindow;
            bw = bpwindow;
            cw = crcwindow;
            sw = swindow;
            //instantiate the player
            player = new Player();
            //make a new map
            map = new Map(7);

            //for the libraries
            mainBookList = new List<Book>() { };

            //these are for data binding in the ClassRaceChoiceWindow. And any other time you might want a list with all of the Classes and Races
            mainClassList = new List<PlayerClass>() { new Knight(), new Lancer(), new Brawler(), new Mage(), new Ranger(), new Rogue(), new BladeDancer(), new Assassin(), new DreadKnight(), new Jester() };
            mainRaceList = new List<Race>() { new Human(), new Elf(), new Dwarf(), new Orc(), new Lycanthrope(), new Halfdragon(), new Revenant(), new Djinn(), new Vampire(), new Demon() };
        }
コード例 #2
0
ファイル: Init.cs プロジェクト: sapeornis/Realm2
 public void Initialize(MainWindow window, BackpackWindow bpwindow, ClassRaceChoiceWindow crcwindow, StatWindow swindow)
 {
     Program.main = new Main(window, bpwindow, crcwindow, swindow);
     bpwindow.itemBox.ItemsSource = Program.main.player.backpack;
     window.Title = "Realm 2: " + GetTitle();
     if (!Program.noUpdate)
     {
         //if the game needs an update show the update dialog
         FileIO fi = new FileIO();
         if (fi.checkver())
         {
             DownloadNewVersionWindow dnvw = new DownloadNewVersionWindow(window);
             dnvw.Show();
         }
     }
     string temppath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\test.exe";
     if (File.Exists(temppath))
         File.Delete(temppath);
     Program.main.write("Hello there. It looks like you're new to Realm 2.", "Black", true);
     Program.main.write("What is your name?", "SteelBlue");
     Program.main.player.backpack.Add(new Stick());
     Program.main.gm = GameState.GettingPlayerInfo;
 }
コード例 #3
0
 public DownloadNewVersionWindow(MainWindow window)
 {
     w = window;
     InitializeComponent();
 }