source: 2014/koodauskerho/38/JuhoJ/Teksti seikkailu/Teksti seikkailu/MainWindow.xaml.cs @ 5768

Revision 5768, 1.3 KB checked in by jotapoti, 5 years ago (diff)

tekstiseikkailun alku

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Controls;
7using System.Windows.Data;
8using System.Windows.Documents;
9using System.Windows.Input;
10using System.Windows.Media;
11using System.Windows.Media.Imaging;
12using System.Windows.Navigation;
13using System.Windows.Shapes;
14
15namespace Teksti_seikkailu
16{
17    /// <summary>
18    /// Interaction logic for MainWindow.xaml
19    /// </summary>
20    public partial class MainWindow : Window
21    {
22        private Rooms rooms;
23
24        public MainWindow()
25        {
26            InitializeComponent();
27
28            this.rooms = new Rooms();
29           Room yourcell = this.rooms.addroom("Your cell", "You stand next to a crappy bed. There is an hardened steel door that leads to hallway 'C'.");
30            this.rooms.addroom("Dirty tunnel", "Tunnel leads to storage room 'C'.");
31            writetextscreen("You wake up in your cell. You have no memory how you got here but, you know you have to get out of here!");
32            writetextscreen(yourcell.Text);
33
34
35
36
37        }
38        public void writetextscreen(string writetext)
39        {
40            textblock.Text += writetext + "\n";
41            scrollViewer1.UpdateLayout();
42            scrollViewer1.ScrollToBottom();
43
44        }
45    }
46}
Note: See TracBrowser for help on using the repository browser.