示例#1
0
 public void moveRole(RoleModel role)
 {
     if (inter_gui.state != 0)
     {
         return;
     }
     //role在船上
     if (role.isOnBoat())
     {
         CoastModel coast;
         //在结束位置
         if (boat.getBoatPos() == 1)
         {
             coast = endCoast;
         }
         else
         {
             coast = startCoast;
         }
         boat.rolegetOffBoat(role.getName());
         role.setPos(coast.getEmptyPos());
         role.getOnCoast(coast);
         coast.getOnCoast(role);
     }
     else
     {
         CoastModel coast = role.getCoast();
         //船无空位或没有停靠陆地
         if (boat.getEmptyIndex() == -1 || coast.getCoastSign() != boat.getBoatPos())
         {
             return;
         }
         coast.getOffCoast(role.getName());
         role.setPos(boat.getEmptyPos());
         role.getOnboat(boat);
         boat.rolegetOnBoat(role);
     }
     inter_gui.state = CheckGameState();
 }
示例#2
0
    public void RoleMove(RoleModel role)
    {
        complete = SSActionEventType.Started;
        if (role.isOnBoat())
        {
            CoastModel coast;

            if (boat.getBoatPos() == 1)
            {
                coast = endCoast;
            }
            else
            {
                coast = startCoast;
            }
            boat.rolegetOffBoat(role.getName());
            move(role, coast.getEmptyPos());

            role.getOnCoast(coast);
            coast.getOnCoast(role);
        }
        else
        {
            CoastModel coast = role.getCoast();

            if (boat.getEmptyIndex() == -1 || coast.getCoastSign() != boat.getBoatPos())
            {
                return;
            }
            coast.getOffCoast(role.getName());

            move(role, boat.getEmptyPos());
            role.getOnboat(boat);
            boat.rolegetOnBoat(role);
        }
    }