//-----------------------------------------------------------------------------
infra::vector_base infra::operator-(const infra::vector_base& u, 
                                    const infra::vector_base& v) {

  // call the prod function 
  infra::vector outcome(u.size());
  diff(u, v, outcome);
  return outcome;
}
示例#2
0
const MCGame_f* QUndetGame<TFormula, TMove, _player>::minimize() const {
    assert(outcome() == MCGame::UNDETERMINED);
    if (empty()) {
    	delete this;
    	return determined.get(MCGame::opponent<_player>::value);
    } else {
        return MCGameFlyFactory::make(this);
    }
}
示例#3
0
    virtual void become_front() {
        switch (_state) {
          case NEW:
            _state = REPLAY;
            init();
            Randomize(4);  // For the decision to replay intro.
            _game_result = NO_GAME;
            g.random.seed = _random_seed;
            stack()->push(new MainPlay(
                            Handle<Level>(_replay_data.chapter_id - 1), true, &_input_source,
                            false, &_game_result));
            break;

          case REPLAY:
            if (_output_path.has()) {
                String path(format("{0}/debriefing.txt", *_output_path));
                makedirs(path::dirname(path), 0755);
                ScopedFd outcome(open(path, O_WRONLY | O_CREAT, 0644));
                if ((g.victory_text >= 0)) {
                    Resource rsrc("text", "txt", g.victory_text);
                    sfz::write(outcome, rsrc.data());
                    if (_game_result == WIN_GAME) {
                        sfz::write(outcome, "\n\n");
                        Handle<Admiral> player(0);
                        String text = DebriefingScreen::build_score_text(
                                g.time, g.level->parTime,
                                GetAdmiralLoss(player), g.level->parLosses,
                                GetAdmiralKill(player), g.level->parKills);
                        sfz::write(outcome, utf8::encode(text));
                    }
                    sfz::write(outcome, "\n");
                }
            }
            stack()->pop(this);
            break;
        }
    }
示例#4
0
const MCGame_f* DeterminedGame::join(const MCGame_f* other,
                                     const Assignment_f* alpha) const {
    return determined.get(outcome());
}
示例#5
0
const MCGame_f* DeterminedGame::introduce(const ConstantSymbol* tsym,
					  int signature_depth,
					  const Assignment_f* alpha) const {
    return determined.get(outcome());
}
示例#6
0
const MCGame_f* DeterminedGame::forget(const ConstantSymbol* tsym,
				       int signature_depth,
                                       const PointMove* replacement,
                                       const Assignment_f* alpha) const {
    return determined.get(outcome());
}
示例#7
0
const MCGame_f* DeterminedGame::convert() const {
    return determined.get(outcome());
}