示例#1
0
 public void MoveBoat()
 {
     if (boat.IsEmpty() || user_gui.sign != 0)
     {
         return;
     }
     actionManager.moveBoat(boat.getGameObject(), boat.BoatMove(), boat.move_speed);
     user_gui.sign = judge.Check();
 }
示例#2
0
 public void MoveBoat()
 {
     if (boat.IsEmpty() || gui.sign != 0)
     {
         return;
     }
     //boat.BoatMove();
     manager.moveBoat(boat.GetGameObject(), boat.BoatMove(), boat.speed);
     gui.sign = judge.Check();
 }
示例#3
0
    public void MoveRole(RoleModel role)
    {
        if (role.IsOnBoat())
        {
            LandModel land;
            if (boat.GetBoatSign() == false)
            {
                land = end_land;
            }
            else
            {
                land = start_land;
            }
            boat.DeleteRoleByName(role.GetName());
            role.Move(land.GetEmptyPosition());
            role.GoLand(land);
            land.AddRole(role);
        }
        else
        {
            LandModel land = role.GetLandModel();
            if (boat.GetEmptyNumber() == -1 || land.GetLandSign() != boat.GetBoatSign())
            {
                return;
            }

            land.DeleteRoleByName(role.GetName());
            role.Move(boat.GetEmptyPosition());
            role.GoBoat(boat);
            boat.AddRole(role);
        }

        user_gui.sign = judge.Check();
    }
示例#4
0
    public void ObjectIsClicked(GameObjects Objects)
    {
        if (FCActionManager.Complete == SSActionEventType.Started)
        {
            return;
        }
        if (Objects.isOnBoat())
        {
            CoastController whichCoast;
            if (boat.get_State() == -1)
            { // to->-1; from->1
                whichCoast = toCoast;
            }
            else
            {
                whichCoast = fromCoast;
            }

            boat.GetOffBoat(Objects.getName());
            FCActionManager.GameObjectsMove(Objects, whichCoast.getEmptyPosition());
            Objects.getOnCoast(whichCoast);
            whichCoast.getOnCoast(Objects);
        }
        else
        {
            Debug.Log("On Coast!");
            CoastController whichCoast = Objects.getCoastController(); // obejects on coast

            if (boat.getEmptyIndex() == -1)
            {
                return;
            }

            if (whichCoast.get_State() != boat.get_State())   // boat is not on the side of character
            {
                return;
            }

            whichCoast.getOffCoast(Objects.getName());
            FCActionManager.GameObjectsMove(Objects, boat.getEmptyPosition());
            Objects.getOnBoat(boat);
            boat.GetOnBoat(Objects);
        }
        judge.update(fromCoast, toCoast, boat);
        UserGUI.SetState = judge.Check();
    }
示例#5
0
    public void ObjectIsClicked(Character Objects)
    {
        if (FSAmanager.Complete == SSActionEventType.Started)
        {
            return;
        }
        if (Objects.isOnBoat())
        {
            CoastController whichCoast;
            if (boat.get_State() == -1)
            {
                whichCoast = toCoast;
            }
            else
            {
                whichCoast = fromCoast;
            }
            boat.GetOffBoat(Objects.getName());
            FSAmanager.CharacterMove(Objects, whichCoast.getEmptyPosition());
            Objects.getOnCoast(whichCoast);
            whichCoast.getOnCoast(Objects);
        }
        else
        {
            CoastController whichCoast = Objects.getCoastController();

            if (boat.getEmptyIndex() == -1)
            {
                return;
            }

            if (whichCoast.get_State() != boat.get_State())
            {
                return;
            }

            whichCoast.getOffCoast(Objects.getName());
            FSAmanager.CharacterMove(Objects, boat.getEmptyPosition());
            Objects.getOnBoat(boat);
            boat.GetOnBoat(Objects);
        }
        //通知controller游戏结束,显示win或lose
        UserGUI.SetState = judge.Check();
    }
 public void ObjectIsClicked(MyCharacterController tem_char)                 //
 {
     if (manager.Complete == SSActionEventType.started)
     {
         return;
     }
     if (tem_char.isOnBoat())
     {
         CoastController tem_coast;
         if (boat.getTFflag() == -1)
         {
             tem_coast = toCoast;
         }
         else
         {
             tem_coast = fromCoast;
         }
         boat.getOffBoat(tem_char.getName());
         //tem_char.moveToPosition (tem_coast.getEmptyPosition ());
         manager.CharacterMove(tem_char, tem_coast.getEmptyPosition());
         tem_char.getOnCoast(tem_coast);
         tem_coast.getOnCoast(tem_char);
     }
     else
     {
         CoastController tem_coast2 = tem_char.getCoastController();
         if (boat.getEmptyIndex() == -1)
         {
             return;
         }
         if (boat.getTFflag() != tem_coast2.getTFflag())
         {
             return;
         }
         tem_coast2.getOffCoast(tem_char.getName());
         //tem_char.moveToPosition (boat.getEmptyPosition ());
         manager.CharacterMove(tem_char, boat.getEmptyPosition());
         tem_char.getOnBoat(boat);
         boat.getOnBoat(tem_char);
     }
     //check whether game over;
     user.if_win_or_not = judge.Check();
 }
 public void MoveBoat()//移动船
 {
     if (boat.IsEmpty() || user_gui.sign != 0)
     {
         return;
     }
     //boat.BoatMove();
     //动作分离版本改变
     actionManager.moveBoat(boat.getGameObject(), boat.BoatMoveToPosition(), boat.move_speed);
     user_gui.sign = judge.Check((start_land.GetRoleNum())[0], (start_land.GetRoleNum())[1], (end_land.GetRoleNum())[0], (end_land.GetRoleNum())[1]);
     if (user_gui.sign == 1)
     {
         for (int i = 0; i < RoleAmount; i++)
         {
             roles[i].PlayGameOver();
             roles[i + RoleAmount].PlayGameOver();
         }
     }
 }
示例#8
0
 public int Check()
 {
     return(judge.Check((start_land.GetRoleNum())[0], (start_land.GetRoleNum())[1],
                        (end_land.GetRoleNum())[0], (end_land.GetRoleNum())[1],
                        boat.GetRoleNumber(), boat.GetBoatSign()));
 }