-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…mplex yaml parsing, but still not there - yet
- Loading branch information
Showing
23 changed files
with
422 additions
and
88 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
branch: | ||
name: a branch | ||
#source: | ||
# external: tree | ||
|
||
tree-trunk: | ||
name: a tree trunk | ||
#source: | ||
# external: tree | ||
tool: axe | ||
|
||
stone: | ||
name: a stone | ||
#source: | ||
# external: boulder | ||
tool: stone | ||
n: 3 | ||
|
||
sharp-stone: | ||
name: a sharp stone | ||
source: stone | ||
tool: stone | ||
|
||
#small-sharp-stone: | ||
# name: a small, sharp stone | ||
# source: [sharp-stone] | ||
# tool: stone | ||
# n: 2 | ||
# | ||
#stone-hammer: | ||
# name: a stone hammer | ||
# source: [stone, branch] | ||
# | ||
#stone-axe: | ||
# name: a stone axe | ||
# source: [sharp-stone, branch] | ||
# | ||
#stone-spear: | ||
# name: a stone spear | ||
# source: [small-sharp-stone, tree-trunk] |
Empty file.
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,12 @@ | ||
|
||
stone: | ||
name: a stone | ||
|
||
branch: | ||
name: a branch | ||
|
||
trunk: | ||
name: a tree trunk | ||
|
||
boulder: | ||
name: a boulder |
Empty file.
Empty file.
Empty file.
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,3 +1,4 @@ | ||
|
||
strength: 2 | ||
agility: 2 | ||
constitution: 2 | ||
|
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
62 changes: 62 additions & 0 deletions
62
src/main/java/com/github/fabioticconi/alone/screens/CraftItemScreen.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,62 @@ | ||
/* | ||
* Copyright (C) 2017 Fabio Ticconi | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package com.github.fabioticconi.alone.screens; | ||
|
||
import asciiPanel.AsciiPanel; | ||
import com.artemis.utils.BitVector; | ||
import com.github.fabioticconi.alone.systems.ScreenSystem; | ||
|
||
import java.awt.event.KeyEvent; | ||
|
||
/** | ||
* Author: Fabio Ticconi | ||
* Date: 05/11/17 | ||
*/ | ||
public class CraftItemScreen extends AbstractScreen | ||
{ | ||
ScreenSystem screen; | ||
CraftScreen craftScreen; | ||
|
||
@Override | ||
public String header() | ||
{ | ||
return "Crafting item:"; | ||
} | ||
|
||
@Override | ||
public float handleKeys(final BitVector keys) | ||
{ | ||
if (keys.get(KeyEvent.VK_ESCAPE)) | ||
screen.select(PlayScreen.class); | ||
|
||
keys.clear(); | ||
|
||
return 0f; | ||
} | ||
|
||
@Override | ||
public void display(final AsciiPanel terminal) | ||
{ | ||
drawHeader(terminal); | ||
|
||
terminal.writeCenter(craftScreen.craftItem, terminal.getHeightInCharacters()/2); | ||
|
||
// TODO | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
src/main/java/com/github/fabioticconi/alone/screens/CraftScreen.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,85 @@ | ||
/* | ||
* Copyright (C) 2017 Fabio Ticconi | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package com.github.fabioticconi.alone.screens; | ||
|
||
import asciiPanel.AsciiPanel; | ||
import com.artemis.ComponentMapper; | ||
import com.artemis.managers.PlayerManager; | ||
import com.artemis.utils.BitVector; | ||
import com.github.fabioticconi.alone.components.Equip; | ||
import com.github.fabioticconi.alone.components.Inventory; | ||
import com.github.fabioticconi.alone.components.Name; | ||
import com.github.fabioticconi.alone.systems.ActionSystem; | ||
import com.github.fabioticconi.alone.systems.CraftSystem; | ||
import com.github.fabioticconi.alone.systems.ItemSystem; | ||
import com.github.fabioticconi.alone.systems.ScreenSystem; | ||
|
||
import java.awt.event.KeyEvent; | ||
|
||
/** | ||
* Author: Fabio Ticconi | ||
* Date: 05/11/17 | ||
*/ | ||
public class CraftScreen extends AbstractScreen | ||
{ | ||
ComponentMapper<Name> mName; | ||
ComponentMapper<Inventory> mInventory; | ||
ComponentMapper<Equip> mEquip; | ||
|
||
ScreenSystem screen; | ||
ActionSystem sAction; | ||
ItemSystem sItems; | ||
CraftSystem sCraft; | ||
|
||
PlayerManager pManager; | ||
|
||
String craftItem = "Test"; | ||
|
||
@Override | ||
public float handleKeys(final BitVector keys) | ||
{ | ||
if (keys.get(KeyEvent.VK_ESCAPE)) | ||
screen.select(PlayScreen.class); | ||
else | ||
{ | ||
final int pos = getTargetIndex(keys); | ||
|
||
if (pos >= 0) | ||
screen.select(CraftItemScreen.class); | ||
} | ||
|
||
keys.clear(); | ||
|
||
return 0f; | ||
} | ||
|
||
@Override | ||
public void display(final AsciiPanel terminal) | ||
{ | ||
drawHeader(terminal); | ||
|
||
drawList(terminal, sCraft.getRecipeNames()); | ||
} | ||
|
||
@Override | ||
public String header() | ||
{ | ||
return "Craft item:"; | ||
} | ||
} |
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
Oops, something went wrong.