Ejemplo n.º 1
0
void freeKick10::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

    //    if(!rolesIsInit)
    initRole();

    for(int i=0;i<activeAgents.size();i++)
        setTactics(activeAgents.at(i));

    tAttackerMid->isKicker(Vector2D(Field::MaxX*0.7,-sign(wm->ball.pos.loc.y)*0.7*Field::MaxY));
    tAttackerMid->setFreeKickType(kickType::FreeKick10);

    setPositions(activeAgents);

    if(state > 3)
        activeAgents.removeOne(tAttackerMid->getID());

    if( state == 2)
        counter++;

    //    wm->ourRobot[tAttackerLeft->getID()].Status = AgentStatus::RecievingPass;
    //    activeAgents.removeOne(tAttackerLeft->getID());

    //    wm->ourRobot[tAttackerRight->getID()].Status = AgentStatus::RecievingPass;
    //    activeAgents.removeOne(tAttackerRight->getID());

    while(activeAgents.size() > 0)
    {
        wm->ourRobot[activeAgents.takeFirst()].Status = AgentStatus::Idle;
    }
}
Ejemplo n.º 2
0
void freeKick5::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

//    if(!rolesIsInit)
        initRole();

    for(int i=0;i<activeAgents.size();i++)
        setTactics(activeAgents.at(i));

    setPositions();

    int recieverID = tDefenderLeft->getID();

    target = Vector2D(wm->ball.pos.loc.x-2000,-wm->ball.pos.loc.y);
    tAttackerMid->isKicker(target);
    tAttackerMid->setFreeKickType(kickType::FreeKick5);

    if(state > 1)
    {
        activeAgents.removeOne(tAttackerMid->getID());
        if(wm->cmgs.ourIndirectKick())
        {
            wm->ourRobot[recieverID].Status = AgentStatus::RecievingPass;
            activeAgents.removeOne(recieverID);
        }
        tAttackerMid->youHavePermissionForKick(-1);
    }

    while(activeAgents.size() > 0)
    {
        wm->ourRobot[activeAgents.takeFirst()].Status = AgentStatus::Idle;
    }
}
Ejemplo n.º 3
0
void freeKick47::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

    //    if(!rolesIsInit)
    initRole();

    if( state  > 3)
        initRolesB(AttackerRight,DefenderLeft);

    for(int i=0;i<activeAgents.size();i++)
        setTactics(activeAgents.at(i));

    tAttackerMid->isKicker(Vector2D(0.3*Field::MaxX, -sign(wm->ball.pos.loc.y)*(0.6)*Field::MaxY));
    tAttackerMid->setFreeKickType(kickType::FreeKick47);

    setPositions(activeAgents);

    if(state > 3)
        activeAgents.removeOne(tAttackerMid->getID());

    while(activeAgents.size() > 0)
    {
        wm->ourRobot[activeAgents.takeFirst()].Status = AgentStatus::Idle;
    }
}
Ejemplo n.º 4
0
void PlayKickoffOur::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

    initRole();

    for(int i=0;i<activeAgents.size();i++)
        setTactics(activeAgents.at(i));

    setPositions();

    if( wm->cmgs.canKickBall() )
        wm->ourRobot[tAttackerMid->getID()].Status =  AgentStatus::Kicking;

}
Ejemplo n.º 5
0
void freeKick7::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

//    if(!rolesIsInit)
        initRole();

    if( state == 2)
        initRolesB(AttackerLeft,DefenderLeft);

    for(int i=0;i<activeAgents.size();i++)
        setTactics(activeAgents.at(i));

    setPositions(activeAgents);

    int recieverID;

    tAttackerMid->isKicker(Vector2D(0.3*Field::MaxX, -sign(wm->ball.pos.loc.y)*(0.6)*Field::MaxY));
    tAttackerMid->setFreeKickType(kickType::FreeKick7);

    if(state > 1)
    {
        recieverID = tAttackerLeft->getID();

        activeAgents.removeOne(tAttackerMid->getID());
        if(wm->cmgs.ourIndirectKick())
        {
            wm->ourRobot[recieverID].Status = AgentStatus::RecievingPass;
            activeAgents.removeOne(recieverID);
        }
    }
    else
    {
        if( state == 1)
            activeAgents.removeOne(tAttackerMid->getID());

        recieverID = tDefenderLeft->getID();
        wm->ourRobot[recieverID].Status = AgentStatus::RecievingPass;
        activeAgents.removeOne(recieverID);
    }

    while(activeAgents.size() > 0)
    {
        wm->ourRobot[activeAgents.takeFirst()].Status = AgentStatus::Idle;
    }
}
Ejemplo n.º 6
0
void PlayPenaltyOpp::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

    initRole();

    for(int i=0;i<activeAgents.size();i++)
    {
        wm->ourRobot[activeAgents.at(i)].Status = AgentStatus::Idle;
    }

    while( !activeAgents.isEmpty() )
    {
        int index = activeAgents.takeFirst();
        setTactics(index);
    }

    setPositions();
}
Ejemplo n.º 7
0
void PlayStop::execute()
{
    wm->passPoints.clear();
    wm->debug_pos.clear();

    QList<int> activeAgents=wm->kn->ActiveAgents();

    for(int i=0;i<activeAgents.size();i++)
    {
        wm->ourRobot[activeAgents.at(i)].Status = AgentStatus::Idle;
    }

    initRole();

    while (activeAgents.size() >0)
    {
        setTactics(activeAgents.takeFirst());
    }
    setPositions();
}
Ejemplo n.º 8
0
void freeKickDirect::execute()
{
    QList<int> activeAgents=wm->kn->ActiveAgents();

    //    if(!rolesIsInit)
    initRole();

    for(int i=0; i<activeAgents.size(); i++)
        setTactics(activeAgents.at(i));

    setPositions();

    target = Field::oppGoalCenter;
    tAttackerMid->isKicker(target);
    tAttackerMid->setFreeKickType(kickType::Shoot);
    tAttackerMid->youHavePermissionForKick(-1);
    activeAgents.removeOne(tAttackerMid->getID());

    while(activeAgents.size() > 0)
    {
        wm->ourRobot[activeAgents.takeFirst()].Status = AgentStatus::Idle;
    }
}