Exemplo n.º 1
0
TeamWindow::TeamWindow(Team* team, QWidget *parent) : QWidget(parent)
{
    this->team = team;
    ui = new(Ui::TeamWindow);
    ui->setupUi(this);

    for(int i = 0; i < 11; i++ ) {
        Player* pl = team->getPlayerList()[i];
        QString info = pl->getFname() + " "
                + pl->getLname() + " "
                + " att: " + QString::number(pl->getAttackVal()) + " "
                + " def: " + QString::number(pl->getDefenceVal());

        ui->playerList->addItem(info);
    }

    // Set budgets for ui elements.

    QString total = QString::number(team->getTotalBudget()) + " mil. €";
    ui->budgetTotal->setText(total);
    ui->budgetHealthcare->setValue(team->getHealthcareBudget());
    ui->budgetStadion->setValue(team->getStadionBudget());
    ui->budgetTraining->setValue(team->getTrainingBudget());

    setListeners();
}
  /*!
   * @if jp
   * @brief 初期化
   * @else
   * @brief Initialization
   * @endif
   */
  bool
  ComponentObserverConsumer::init(RTObject_impl& rtobj,
                                  const SDOPackage::ServiceProfile& profile)
  {
    if (!m_observer.setObject(profile.service))
      {
        // narrowing failed
        return false;
      }

    m_rtobj = &rtobj;
    m_profile = profile;
    coil::Properties prop;
    NVUtil::copyToProperties(prop, profile.properties);
    setHeartbeat(prop);
    setListeners(prop);
    return true;
  }
Exemplo n.º 3
0
//------------------------------------------------------------------------------ constrcutor
ofxSimpleGui::ofxSimpleGui() {
	
	guiFocus	= 0;
	guiCount	= 0;
	
	mx			= 0;
	my			= 0;
	key			= 0;
	mousedown	= false;
	mouseup		= true;
	xmlFile		= "NULL";
	verbose		= true;
	doRender	= true;
	doAutoSave	= false;
	doSave		= false;
	saveButton	= new ofxToggle("Save XML Settings", &doSave); 
	
	setListeners();
}
 /*!
  * @if jp
  * @brief 再初期化
  * @else
  * @brief Re-initialization
  * @endif
  */
 bool
 ComponentObserverConsumer::reinit(const SDOPackage::ServiceProfile& profile)
 {
   if (!m_observer._ptr()->_is_equivalent(profile.service))
     {
       CorbaConsumer<OpenRTM::ComponentObserver> tmp;
       if (!tmp.setObject(profile.service))
         {
           return false;
         }
       m_observer.releaseObject();
       m_observer.setObject(profile.service);
     }
   m_profile= profile;
   coil::Properties prop;
   NVUtil::copyToProperties(prop, profile.properties);
   setHeartbeat(prop);
   setListeners(prop);
   return true;
 }
Exemplo n.º 5
0
MarketWindow::MarketWindow(Team* team, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MarketWindow)
{
    this->team = team;
    ui->setupUi(this);
    setListeners();
    teamPlayerCount = 10;

    srand (time(NULL));

    for(int i = 0; i < 10; i++ ) {
        Player* pl = team->getPlayerList()[i];
        QString info = pl->getFname() + " "
                + pl->getLname() + " "
                + " att: " + QString::number(pl->getAttackVal()) + " "
                + " def: " + QString::number(pl->getDefenceVal());

        ui->teamList->addItem(info);
    }

    QString fnames[20] = {"Diego", "Ronaldo", "Michael", "Wayne",
                      "Harry", "Sam", "Rooger", "Henry", "Marty",
                      "Gordon", "Harry", "Maxwell", "Bart", "Ian",
                      "Samuel", "Juan", "Michael", "Bern", "Rex", "George"};

    for(int i = 0; i < 20; i++ ) {
        int attack = rand() % 50 + 50;
        int defence = rand() % 50 + 50;
        Player pl(fnames[i], "Jordan", attack, defence);
        QString info = pl.getFname() + " "
                + pl.getLname() + " "
                + "att: " + QString::number(pl.getAttackVal()) + " "
                + "def: " + QString::number(pl.getDefenceVal());

        ui->marketList->addItem(info);
    }
}
Exemplo n.º 6
0
SourceManager::SourceManager(QObject *parent)
    : QObject(parent)
{
    setListeners();
    client = new SyncClient();
}