Package com.insightfullogic.slab

Examples of com.insightfullogic.slab.GameEvent


        final long[] lives = { 5000, 4000, 3000, 2000, 1000 };

        // Create objects
        for (int i = 0; i < OBJECTS_ALLOCATED; i++) {
      GameEvent event = values.get(i);
      event.setId(i);
      event.setStrength(i % 50);
      event.setTarget(i % 5);
    }

        final long middle = System.nanoTime();

        // Use objects
        for (int i = 0; i < OBJECTS_ALLOCATED; i++) {
      GameEvent event = values.get(i);
      int target = event.getTarget();
      long lifeRemaining = lives[target];
      if (lifeRemaining > 0) {
        lives[target] = lifeRemaining - event.getStrength();
      }
        }

        final long reads = System.nanoTime() - middle;
        final long writes = middle - start;
View Full Code Here

TOP

Related Classes of com.insightfullogic.slab.GameEvent

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.