Beispiel #1
0
        //Console console = new Console();


        public MainWindow()
        {
            InitializeComponent();
            DataContext = new UnnamedDataContext(console);


            console.Inlines.Add(new Run("test")
            {
                Foreground = new SolidColorBrush(Color.FromRgb(255, 0, 255))
            });
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
            console.Append("yes!\n");
        }
Beispiel #2
0
        public Submenu(UnnamedDataContext ctx, Func <UnnamedMenu> prevMenu)
            : base(ctx, prevMenu)
        {
            ThisMenu = () => new MainMenu(Ctx, prevMenu);

            Options = new ObservableCollection <Option>();
            Options.Add(new Option("Back", () => Next(PrevMenu())));
            Options.Add(new Option("text", () => Debug.Write("asdas")));
            Options.Add(new Option("text", () => Debug.Write("asdas")));
        }
Beispiel #3
0
        public MainMenu(UnnamedDataContext ctx, Func <UnnamedMenu> prevMenu)
            : base(ctx, prevMenu)
        {
            ThisMenu = () => new MainMenu(ctx, prevMenu);

            Options = new ObservableCollection <Option>();
            Options.Add(new Option("Start Test Event", () => Next(new EventMenu(Ctx, ThisMenu, "test.xml"))));
            Options.Add(new Option("submenu", () => Next(new Submenu(Ctx, ThisMenu))));
            Options.Add(new Option("Pass Time", () => Ctx.Time.Pass(3)));
            Options.Add(new Option("Start Test Combat", () => new Combat(Ctx, ThisMenu, ThisMenu, Ctx.Player, new Entity(Ctx))));
            Options.Add(new Option("Console Test", () => ctx.Cnsl.Append("test")));
        }
Beispiel #4
0
        public Combat(UnnamedDataContext ctx, Func <UnnamedMenu> winFunc, Func <UnnamedMenu> lossFunc, Entity player, Entity enemy)
        {
            Player = player;
            Enemy  = enemy;
            Ctx    = ctx;


            WinFunc  = winFunc;
            LossFunc = lossFunc;


            StartCombat();
        }
Beispiel #5
0
        public EventMenu(UnnamedDataContext ctx, Func <UnnamedMenu> prevMenu, String eventFile)
            : base(ctx, prevMenu)
        {
            ThisMenu = () => new EventMenu(ctx, prevMenu, eventFile);


            Options = new ObservableCollection <Option>();
            doc     = new XmlDocument();

            Debug.WriteLine(ctx.PlayerOptions.Menu);

            doc.Load("data/" + eventFile);
            CurrentNode = doc.SelectSingleNode("//branch[@key='start']").FirstChild;
            ProcessNode(CurrentNode);
        }
Beispiel #6
0
        public Entity(UnnamedDataContext ctx)
        {
            Ctx = ctx;
            Ctx.Time.PropertyChanged += Time_PropertyChanged;

            Abilities = new List <Ability>();
            Items     = new List <Item>();


            EntityEvent += new TestEffect().Activate;


            _hp = 3;

            TestEvent();
        }
Beispiel #7
0
 public UnnamedMenu(UnnamedDataContext ctx, Func <UnnamedMenu> prevMenu)
 {
     Ctx      = ctx;
     PrevMenu = prevMenu;
 }
Beispiel #8
0
 public OptionsData(UnnamedDataContext ctx)
 {
     OptionsStack = new Stack <Func <UnnamedDataContext, ObservableCollection <Option> > >();
     this.ctx     = ctx;
     Menu         = new MainMenu(ctx, null);
 }