Package transientlibs.objects.general

Examples of transientlibs.objects.general.Dice


    public void getCard(Action ofAction) {
        hand.add(new Card(ofAction));
    }

    public void drawCard(NodeArrayList<Action> collectedCards) {
        Dice cardRoller = new Dice();

        for (Action a : collectedCards) {
            cardRoller.addOption(a.adjustedChanceToDraw, a.ID);
        }

        cardRoller.rollDice();

        getCard(Action.getActionByID(cardRoller.resultID));

        Log.info("Card drawn: " + hand.get(hand.size() - 1).action.LName);
    }
View Full Code Here


        //Log.info(LName);
    }

    public void rollLooks (){
     Dice dice = new Dice();

        //Iterator<Interval> i = fromList.iterator();

        //while ((i.hasNext()) && (result == null)) {
//                nowInterval = i.next();

//        dice.addOption(Gender, ID);

        ArrayList<Looks> nowGroup;
        LookType nowLookType;
        Looks nowLook;
        int nowType;
        int nowID;

        //fill all look types
        //Log.info("Look types count: " + Looks.lookTypes.size());

        for (nowType = 0; nowType < Looks.lookTypes.size(); nowType++) {

            //nowLookType = Looks.lookTypes.get(nowType);

            nowGroup = Looks.looks.get(nowType);
            //Log.info(nowLookType+": "+LName);

            //fill all looks of this type
            for (nowID = 0; nowID < nowGroup.size(); nowID++) {
                dice.addOption(nowGroup.get(nowID).frequency, nowID);

                //Log.info("Filling chances for look " + nowGroup.get(nowID).LName);
            }

            dice.rollDice();

            looks.add(new SmallPoints(dice.resultID, 100));

            //Log.info("Rolled "+nowGroup.get(dice.resultID).LName);

            dice.reset();

        }
    }
View Full Code Here

        }
    }

    public void rollJob (){

        Dice dice = new Dice();
        int nowID;

for (nowID = 0; nowID < Job.jobs.size(); nowID++) {
                dice.addOption(Job.jobs.get(nowID).frequency, nowID);
            }

            dice.rollDice();

            job = Job.jobs.get(dice.resultID);


    }
View Full Code Here

TOP

Related Classes of transientlibs.objects.general.Dice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.