Skip to content

Commit

Permalink
Move xcom from /gaming to /games
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnangovindraj committed Feb 21, 2023
1 parent 44f7506 commit 807b101
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .factory/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ build:
bazel run //:typedb-extractor -- dist/typedb-all-linux
sudo systemd-run ./dist/typedb-all-linux/typedb server
sleep 60
bazel test //gaming/xcom:test --test_output=errors
bazel test //games/xcom:test --test_output=errors
performance:
test-performance-typedb-core-server:
machine: 16-core-64-gb
Expand Down Expand Up @@ -165,4 +165,4 @@ build:
bazel run //:typedb-extractor -- dist/typedb-all-linux
sudo systemd-run ./dist/typedb-all-linux/typedb server
sleep 60
bazel test //gaming/xcom:test --test_output=errors --runs_per_test=20 --jobs=1
bazel test //games/xcom:test --test_output=errors --runs_per_test=20 --jobs=1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Read the [README](commerce/bookstore/README.md) file for instructions. Check [th
or the initial [dataset](commerce/bookstore/python/data) for additional information. All logic accessible in the script
files in the [python](commerce/bookstore/python) directory.

### [Gaming: XCOM Project](gaming/xcom)
### [Games: XCOM Project](games/xcom)

The XCOM 2 example contains a database of interdependent research tasks in the game XCOM 2, featuring automatic
inference of available research based on completed tasks and available items. See [the schema](gaming/xcom/schema.tql)
inference of available research based on completed tasks and available items. See [the schema](games/xcom/schema.tql)
for the examples of reasoner rules inferring attributes.

### [Software: GitHub](software/github)
Expand Down
12 changes: 6 additions & 6 deletions gaming/xcom/BUILD → games/xcom/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ java_library(

java_test(
name = "test",
classpath_resources = ["//gaming/xcom/config:logback-xml"],
test_class = "com.vaticle.typedb.example.gaming.xcom.XCOMTest",
classpath_resources = ["//games/xcom/config:logback-xml"],
test_class = "com.vaticle.typedb.example.games.xcom.XCOMTest",
srcs = [
"XCOMTest.java"
],
Expand All @@ -68,8 +68,8 @@ java_test(

java_binary(
name = "migration",
classpath_resources = ["//gaming/xcom/config:logback-xml"],
main_class = "com.vaticle.typedb.example.gaming.xcom.Migration",
classpath_resources = ["//games/xcom/config:logback-xml"],
main_class = "com.vaticle.typedb.example.games.xcom.Migration",
srcs = ["Migration.java"],
deps = [
"@vaticle_typedb_client_java//:client-java",
Expand All @@ -84,8 +84,8 @@ java_binary(

java_binary(
name = "queries",
classpath_resources = ["//gaming/xcom/config:logback-xml"],
main_class = "com.vaticle.typedb.example.gaming.xcom.Queries",
classpath_resources = ["//games/xcom/config:logback-xml"],
main_class = "com.vaticle.typedb.example.games.xcom.Queries",
srcs = ["Queries.java", "TransactionMode.java", "ResearchTask.java", "InventoryItem.java", "Result.java"],
deps = [
"@vaticle_typedb_client_java//:client-java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

public class InventoryItem {
public InventoryItem(String name, long quantity) {
Expand Down
12 changes: 6 additions & 6 deletions gaming/xcom/Migration.java → games/xcom/Migration.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

import com.univocity.parsers.csv.CsvParser;
import com.univocity.parsers.csv.CsvParserSettings;
Expand Down Expand Up @@ -82,7 +82,7 @@ static void connectAndMigrate(Collection<Input> inputs, String databaseName) thr
TypeDBSession schemaSession = client.session(databaseName, TypeDBSession.Type.SCHEMA);
TypeDBTransaction schemaTransaction = schemaSession.transaction(TypeDBTransaction.Type.WRITE);
Writer queryBuffer = new StringWriter();
getReader("gaming/xcom/schema.tql").transferTo(queryBuffer);
getReader("games/xcom/schema.tql").transferTo(queryBuffer);
schemaTransaction.query().define(queryBuffer.toString());
schemaTransaction.commit();
System.out.println("\nCreated the database.\n");
Expand Down Expand Up @@ -111,7 +111,7 @@ static Collection<Input> initialiseInputs() {

/** define template for constructing a research project TypeQL insert query */
static Input initialiseTechInput() {
return new Input("gaming/xcom/data/tech") {
return new Input("games/xcom/data/tech") {
@Override
public String template(Json researchProject) {
return "insert $research_project isa research-project, has name " + researchProject.at("name") + ";";
Expand All @@ -121,7 +121,7 @@ public String template(Json researchProject) {

/** define template for constructing a research project tech requirement TypeQL insert query */
static Input initialiseResearchProjectTechRequirementInput() {
return new Input("gaming/xcom/data/tech_required_tech") {
return new Input("games/xcom/data/tech_required_tech") {
@Override
public String template(Json techRequirement) {
// match tech
Expand All @@ -137,7 +137,7 @@ public String template(Json techRequirement) {

/** define template for constructing an item TypeQL insert query */
static Input initialiseItemInput() {
return new Input("gaming/xcom/data/resource") {
return new Input("games/xcom/data/resource") {
@Override
public String template(Json item) {
return "insert $item isa item, has name " + item.at("name") + ";";
Expand All @@ -147,7 +147,7 @@ public String template(Json item) {

/** define template for constructing a research project resource cost TypeQL insert query */
static Input initialiseResearchResourceCostInput() {
return new Input("gaming/xcom/data/tech_required_resource") {
return new Input("games/xcom/data/tech_required_resource") {
@Override
public String template(Json researchCost) {
// match tech
Expand Down
2 changes: 1 addition & 1 deletion gaming/xcom/Queries.java → games/xcom/Queries.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

import com.vaticle.typedb.client.TypeDB;
import com.vaticle.typedb.client.api.TypeDBClient;
Expand Down
6 changes: 3 additions & 3 deletions gaming/xcom/README.md → games/xcom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ is able to fetch the correct answer in one simple query.

1. Checkout this repository: `git clone https://github.com/vaticle/typedb-examples && cd typedb-examples`
2. Start the [TypeDB Server](http://docs.vaticle.com/docs/running-typedb/install-and-run#start-the-typedb-server).
3. Build the example: `bazel build //gaming/xcom/...`.
4. Migrate the dataset into TypeDB: `bazel run //gaming/xcom:migration`.
5. Launch the interactive query runner: `bazel run //gaming/xcom:queries`.
3. Build the example: `bazel build //games/xcom/...`.
4. Migrate the dataset into TypeDB: `bazel run //games/xcom:migration`.
5. Launch the interactive query runner: `bazel run //games/xcom:queries`.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

public class ResearchTask {
public ResearchTask(String name, double progressPercent) {
Expand Down
2 changes: 1 addition & 1 deletion gaming/xcom/Result.java → games/xcom/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

public class Result<T> {
public Result() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

public enum TransactionMode {
READ,
Expand Down
2 changes: 1 addition & 1 deletion gaming/xcom/XCOMTest.java → games/xcom/XCOMTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* under the License.
*/

package com.vaticle.typedb.example.gaming.xcom;
package com.vaticle.typedb.example.games.xcom;

import com.vaticle.typedb.client.TypeDB;
import com.vaticle.typedb.client.api.TypeDBClient;
Expand Down
2 changes: 1 addition & 1 deletion gaming/xcom/config/BUILD → games/xcom/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")

package(default_visibility = ["//gaming/xcom:__pkg__"])
package(default_visibility = ["//games/xcom:__pkg__"])

filegroup(
name = "logback-xml",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.

0 comments on commit 807b101

Please sign in to comment.