コード例 #1
0
        private static short getTotalNumOfDoors_old(SimplifiedLayoutDataPacket simpleDataPacket, byte numOfKeys)
        {
            short numOfDoors = 0;

            if (numOfKeys > 0)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance1();
            }
            if (numOfKeys > 1)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance2();
            }
            if (numOfKeys > 2)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance3();
            }
            if (numOfKeys > 3)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance4();
            }
            if (numOfKeys > 4)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance5();
            }
            if (numOfKeys > 5)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance6();
            }

            return(numOfDoors);
        }
コード例 #2
0
        private static short getTotalNumOfDoors(SimplifiedLayoutDataPacket simpleDataPacket, byte[] clearanceDemoter, byte numOfKeys)
        {
            if (numOfKeys == 0)
            {
                return(0);
            }

            short numOfDoors = 0;

            if (clearanceDemoter[1] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance1();
            }
            if (clearanceDemoter[2] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance2();
            }
            if (clearanceDemoter[3] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance3();
            }
            if (clearanceDemoter[4] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance4();
            }
            if (clearanceDemoter[5] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance5();
            }
            if (clearanceDemoter[6] != clearance_null)
            {
                numOfDoors += simpleDataPacket.getNumOfDoors_clearance6();
            }

            return(numOfDoors);
        }