コード例 #1
0
        public void IsValid()
        {
            action = new BattleAction(String.Empty);
            Assert.That(action.IsValid(), Is.False);

            action.AlterInfo("name", .5, 0);
            Assert.That(action.IsValid(), Is.True);

            action.AlterInfo(String.Empty, .5, 0);
            Assert.That(action.IsValid(), Is.False);

            action.AlterInfo("name", 0, 0);
            Assert.That(action.IsValid(), Is.False);
        }
コード例 #2
0
        private void AddActionToPartyMember(Object sender, RoutedEventArgs e)
        {
            var action = new BattleAction(String.Empty);
            var addActionWindow = new EditAction(action);
            addActionWindow.Owner = this;
            addActionWindow.ShowDialog();

            if (action.IsValid())
                partyViewModel.AddActionToPartyMember(action);

            fileAccessor.SaveParty(partyViewModel.Party);
        }
コード例 #3
0
        private void Save(Object sender, RoutedEventArgs e)
        {
            var action = new BattleAction(String.Empty);
            var newActionWindow = new EditAction(action);

            newActionWindow.Owner = this;
            newActionWindow.ShowDialog();

            if (action.IsValid())
                participantViewModel.AddAction(action);

            Close();
        }