示例#1
0
        public static IBill GetAnotherBill(IBill bill)
        {
            for (; bill.IsImplementable() == false; bill = GetRandomBill())
            {
                ;
            }
            return(bill);

            #region old codes
            //System.Random rand = new System.Random();

            //// 8 is a id of non-exist bill
            //int avoidIdx0 = 8;
            //int avoidIdx1 = 8;
            //int avoidIdx2 = 8;
            //int avoidIdx3 = 8;
            //if (Politics.residentTax >= 20) {
            //	avoidIdx0 = 0;
            //} else if (Politics.residentTax <= 1) {
            //	avoidIdx0 = 1;
            //}

            //if (Politics.commercialTax >= 20) {
            //	avoidIdx2 = 4;
            //} else if (Politics.commercialTax <= 1) {
            //	avoidIdx2 = 5;
            //}

            //if (Politics.industryTax >= 20) {
            //	avoidIdx3 = 6;
            //} else if (Politics.industryTax <= 1) {
            //	avoidIdx3 = 7;
            //}

            //if (Politics.benefitOffset >= 100) {
            //	avoidIdx1 = 2;
            //} else if (Politics.benefitOffset <= 0) {
            //	avoidIdx1 = 3;
            //}

            //if ((orgIdx == avoidIdx0) || (orgIdx == avoidIdx1) || (orgIdx == avoidIdx2) || (orgIdx == avoidIdx3)) {
            //	while (true) {
            //		byte returnValue = (byte)rand.Next(8);
            //		if (!((returnValue == avoidIdx0) || (returnValue == avoidIdx1) || (returnValue == avoidIdx2) || (returnValue == avoidIdx3))) {
            //			return returnValue;
            //		}
            //	}
            //} else {
            //	return orgIdx;
            //}
            #endregion
        }