Skip to content

Commit

Permalink
Merge pull request #7 from TemirkhanN/main
Browse files Browse the repository at this point in the history
Item types, activities carcass, qa tools
  • Loading branch information
crilleaz committed Sep 6, 2023
2 parents ded57ce + f36fbae commit 5de2dbd
Show file tree
Hide file tree
Showing 98 changed files with 3,033 additions and 895 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [ push ]

jobs:
tests:
qa:
runs-on: ubuntu-20.04
env:
DB_HOST: 127.0.0.1
Expand All @@ -22,16 +22,17 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-php@master
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: xdebug
- name: install vendors
run: composer install --no-interaction
- name: install project
run: php install.php
# - name: codestyle
# run: ./vendor/bin/phpcs
# - name: static analyze
# run: ./vendor/bin/phpstan
- name: codestyle
run: ./vendor/bin/phpcs
- name: static analyze
run: ./vendor/bin/phpstan
- name: tests
run: ./vendor/bin/phpunit
run: php -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ log.txt
.phpunit.result.cache
var/**
!var/.gitkeep
.phpstan
.phpcs-cache
4 changes: 3 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function init(): void
}

/**
* @template T
* @template T of object
*
* @param class-string<T> $id
* @return T
Expand All @@ -60,6 +60,8 @@ public static function getService(string $id): object
if (self::$container === null) {
self::init();
}

// @phpstan-ignore-next-line
return self::$container->get($id);
}
}
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"autoload": {
"psr-4": {
"Game\\": "src/"
}
},
"files": [
"utils.php"
]
},
"autoload-dev": {
"psr-4": {
Expand All @@ -22,6 +25,8 @@
"symfony/http-foundation": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^10.3"
"phpunit/phpunit": "^10.3",
"phpstan/phpstan": "^1.10",
"free2er/coding-standard": "^1.1"
}
}
156 changes: 155 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions data/activity_option.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Lumberjack:
- id: 1
name: 'Hollow tree'
description: 'Hollow tree. Can be sold as fuel for a coin or two.'
complexity: 1
reward_exp: 5
reward_item_id: 6

- id: 2
name: 'Oak tree'
description: 'Strong tree. They say hogs love hanging around it.'
complexity: 3
reward_exp: 8
reward_item_id: 7
Farmer:
- id: 1
name: 'Hay field'
description: 'Dried grass that is usually used to feed cows.'
complexity: 1
reward_exp: 5
reward_item_id: 8
- id: 2
name: 'Potato field'
description: 'Grows underground. Does not need much and yields plenty of resource.'
complexity: 3
reward_exp: 8
reward_item_id: 9
25 changes: 25 additions & 0 deletions data/item.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,44 @@
id: 1
name: 'Gold Coins'
worth: 1
type: 'currency'
-
id: 2
name: Cheese
worth: 2
type: 'consumable'
-
id: 3
name: 'Short Sword'
worth: 18
type: 'weapon'
-
id: 4
name: 'Animal hide'
worth: 2
type: 'material'
-
id: 5
name: Leather
worth: 5
type: 'material'
-
id: 6
name: 'Firewood bundle'
worth: 1
type: 'material'
-
id: 7
name: Oak plank
worth: 2
type: 'material'
-
id: 8
name: 'Hay bale'
worth: 1
type: 'material'
-
id: 9
name: 'Potato'
worth: 2
type: 'consumable'
5 changes: 5 additions & 0 deletions data/item_effect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
name: 'Restore stamina'
type: 1
power: 5
-
item_id: 9
name: 'Restore stamina'
type: 1
power: 3
Loading

0 comments on commit 5de2dbd

Please sign in to comment.