-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted the grammar system to engine changes...
- Loading branch information
1 parent
624dea5
commit 2e48a04
Showing
29 changed files
with
798 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ | ||
"id" : "GrammarSystem", | ||
"version" : "0.1.0", | ||
"version" : "0.2.0-SNAPSHOT", | ||
"author" : "Skaldarnar", | ||
"displayName" : "Grammar System", | ||
"description" : "Grammar System for procedural structure generation. Basis for the Procedural Architecture Grammar", | ||
"dependencies" : [], | ||
"dependencies" : [ | ||
{ | ||
"id": "Core", "minVersion": "1.0.0" | ||
} | ||
], | ||
"isServerSideOnly" : false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 18 additions & 3 deletions
21
...ystem/logic/grammar/ProductionSystem.java → ...ammar/logic/grammar/ProductionSystem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/org/terasology/grammar/logic/grammar/assets/Grammar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2016 MovingBlocks | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.terasology.grammar.logic.grammar.assets; | ||
|
||
import com.google.common.base.Preconditions; | ||
import org.terasology.assets.AssetData; | ||
import org.terasology.assets.ResourceUrn; | ||
import org.terasology.grammar.logic.grammar.ProductionSystem; | ||
|
||
public class Grammar implements AssetData { | ||
|
||
private ResourceUrn urn; | ||
|
||
private ProductionSystem productionSystem; | ||
|
||
//TODO: store additional header information somehow | ||
|
||
/** | ||
* A new grammar object is created with the given production system.. | ||
* | ||
* @param productionSystem the production system - not null. | ||
*/ | ||
public Grammar(ProductionSystem productionSystem) { | ||
Preconditions.checkArgument(productionSystem != null); | ||
this.productionSystem = productionSystem; | ||
} | ||
|
||
public ProductionSystem getProductionSystem() { | ||
return productionSystem; | ||
} | ||
|
||
public ResourceUrn getUrn() { | ||
return urn; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/org/terasology/grammar/logic/grammar/shapes/complex/ComplexRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2016 MovingBlocks | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.terasology.grammar.logic.grammar.shapes.complex; | ||
|
||
import org.terasology.grammar.logic.grammar.shapes.Shape; | ||
|
||
import java.util.List; | ||
|
||
/** @author Tobias 'skaldarnar' Nett */ | ||
public abstract class ComplexRule extends Shape { | ||
|
||
/** | ||
* Returns the successor elements of this complex shape. | ||
* <p/> | ||
* The successor elements of a complex shape are for example the arguments of a _divide_ or _repeat_ rule. The successor elements cannot | ||
* be simply looked up in the org.terasology.logic.grammar rules but rather depend on the specific complex shape rule/command they | ||
* belong to. | ||
* | ||
* @return the successor elements of the complex shape rule | ||
*/ | ||
public abstract List<Shape> getElements(); | ||
} |
21 changes: 18 additions & 3 deletions
21
...gic/grammar/shapes/complex/DivideArg.java → ...gic/grammar/shapes/complex/DivideArg.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.