コード例 #1
0
    //0 - pilot1, 1 - engineer1, 2-pilot2, 3-engineer2

    int GetSlot(ControllerInterface.ContState cont)
    {
        bool slot0 = false;
        bool slot1 = false;

        foreach (ControllerInterface i in controllerInterfaces)
        {
            if (i.cont == cont && i.mySlot == 0)
            {
                slot0 = true;
            }
            else if (i.cont == cont && i.mySlot == 1)
            {
                slot1 = true;
            }
        }
        if (slot0 && slot1)
        {
            return(-1);
        }
        if (!slot0)
        {
            return(0);
        }
        return(1);
    }
コード例 #2
0
 bool CheckRole(ControllerInterface.ContState cont, ControllerInterface.RoleState role)
 {
     foreach (ControllerInterface i in controllerInterfaces)
     {
         if (i.role == role && i.cont == cont)
         {
             return(true);
         }
     }
     return(false);
 }