use of com.google.cloud.videointelligence.v1p2beta1.Entity in project KomanJava by dpsclem.
the class Map method CreateRandomMap.
public static Map CreateRandomMap() {
var table = new Cell[Map.MapWidth][Map.MapHeight];
for (int i = 0; i < Map.MapWidth; i++) {
for (int j = 0; j < Map.MapHeight; j++) {
if (ThreadLocalRandom.current().nextInt(1, 11) == 1)
table[i][j] = new Cell(CellMaterial.Wall, i, j);
else
table[i][j] = new Cell(CellMaterial.Floor, i, j);
}
}
var randomMap = new Map(table);
randomMap.addItemOnMap(new Item("key", 10, "file:resources/graphics/sprite/key.png"), 3, 3);
randomMap.addItemOnMap(new Item("pioche", 10, "file:resources/graphics/sprite/pioche.png"), 3, 5);
randomMap.addItemOnMap(new Usable("moneybag", 0, false, UsableType.MONEYBAG, null, 15, "file:resources/graphics/sprite/moneybag.png"), 8, 2);
randomMap.addEntityOnMap(new Entity(2, 2, EntityStatus.INACTIVE, EntityType.MONSTER, "file:resources/graphics/sprite/monster1.gif"));
return randomMap;
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project KomanJava by dpsclem.
the class Map method UpdateWithRandomMap.
public void UpdateWithRandomMap() {
table = new Cell[Map.MapWidth][Map.MapHeight];
for (int i = 0; i < Map.MapWidth; i++) {
for (int j = 0; j < Map.MapHeight; j++) {
if (ThreadLocalRandom.current().nextInt(1, 11) == 1)
table[i][j] = new Cell(CellMaterial.Wall, i, j);
else
table[i][j] = new Cell(CellMaterial.Floor, i, j);
}
}
this.addItemOnMap(new Item("key", 10, "file:resources/graphics/sprite/key.png"), 3, 3);
this.addItemOnMap(new Item("pioche", 10, "file:resources/graphics/sprite/pioche.png"), 3, 5);
this.addItemOnMap(new Item("coin", 10, "file:resources/graphics/sprite/moneybag.png"), 8, 5);
this.addEntityOnMap(new Entity(5, 5, EntityStatus.INACTIVE, EntityType.MONSTER, "file:resources/graphics/sprite/monster1.gif"));
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project grpc-gcp-java by GoogleCloudPlatform.
the class DataStoreChecksumClient method simpleLookup.
private static void simpleLookup(DatastoreBlockingStub stub, String projectId) {
PathElement pathElement = PathElement.newBuilder().setKind("Person").setName("weiranf").build();
Key key = Key.newBuilder().addPath(pathElement).build();
LookupRequest lookupRequest = LookupRequest.newBuilder().setProjectId(projectId).addKeys(key).build();
LookupResponse lookupResponse = stub.lookup(lookupRequest);
if (lookupResponse.getFoundCount() > 0) {
System.out.println("ENTITY FOUND:");
Entity entity = lookupResponse.getFound(0).getEntity();
Map<String, Value> map = entity.getPropertiesMap();
for (Map.Entry<String, Value> entry : map.entrySet()) {
System.out.printf("%s => %s\n", entry.getKey(), entry.getValue().getStringValue());
}
} else {
System.out.println("NO ENTITY FOUND!");
}
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project SilkSpawners by timbru31.
the class NMSHandler method spawnEntity.
@Override
public void spawnEntity(final org.bukkit.World w, final String entityID, final double x, final double y, final double z, final Player player) {
final NBTTagCompound tag = new NBTTagCompound();
tag.setString("id", entityID);
final World world = ((CraftWorld) w).getHandle();
final Entity entity = EntityTypes.a(tag, world);
if (entity == null) {
Bukkit.getLogger().warning("[SilkSpawners] Failed to spawn, falling through. You should report this (entity == null)!");
return;
}
final float yaw = world.random.nextFloat() * (-180 - 180) + 180;
entity.setPositionRotation(x, y, z, yaw, 0);
world.addEntity(entity, SpawnReason.SPAWNER_EGG);
final PacketPlayOutEntityHeadRotation rotation = new PacketPlayOutEntityHeadRotation(entity, (byte) yaw);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(rotation);
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project SilkSpawners by timbru31.
the class NMSHandler method spawnEntity.
@SuppressWarnings("resource")
@Override
public void spawnEntity(final org.bukkit.World w, final String entityID, final double x, final double y, final double z, final Player player) {
final NBTTagCompound tag = new NBTTagCompound();
tag.setString("id", entityID);
final World world = ((CraftWorld) w).getHandle();
final Entity entity = EntityTypes.a(tag, world);
if (entity == null) {
Bukkit.getLogger().warning("[SilkSpawners] Failed to spawn, falling through. You should report this (entity == null)!");
return;
}
final float yaw = world.random.nextFloat() * (-180 - 180) + 180;
entity.setPositionRotation(x, y, z, yaw, 0);
world.addEntity(entity, SpawnReason.SPAWNER_EGG);
final PacketPlayOutEntityHeadRotation rotation = new PacketPlayOutEntityHeadRotation(entity, (byte) yaw);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(rotation);
}
Aggregations