Skip to content

Commit 355078c

Browse files
committed
introduce fight and ai
1 parent ae050c9 commit 355078c

File tree

24 files changed

+63
-19
lines changed

24 files changed

+63
-19
lines changed

.idea/fileTemplates/includes/C File Header.h

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/fileTemplates/internal/JavaScript File.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ set(SOURCE_FILES src/main.c
2424
src/map/rectangle.h
2525
src/map/fov.c
2626
src/map/fov.h
27-
src/data/list.h src/data/enums.h src/components/fighter.c src/components/fighter.h)
27+
src/data/list.h src/data/enums.h src/components/fighter.c src/components/fighter.h src/components/ai.c src/components/ai.h)
2828

2929
add_executable(libtcod-tutorial ${SOURCE_FILES})
3030
target_link_libraries(libtcod-tutorial libtcod)

cmake-build-debug/libtcod-tutorial.cbp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
</MakeCommands>
8585
</Target>
8686
</Build>
87+
<Unit filename="/cygdrive/e/code/c/libtcod-tutorial/src/components/ai.c">
88+
<Option target="libtcod-tutorial"/>
89+
</Unit>
90+
<Unit filename="/cygdrive/e/code/c/libtcod-tutorial/src/components/ai.h">
91+
<Option target="libtcod-tutorial"/>
92+
</Unit>
8793
<Unit filename="/cygdrive/e/code/c/libtcod-tutorial/src/components/fighter.c">
8894
<Option target="libtcod-tutorial"/>
8995
</Unit>

src/components/ai.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// Created by Saturnation on 4/11/2018.
3+
//
4+
5+
#include <stdio.h>
6+
#include "ai.h"
7+
8+
void take_turn(ai *ai) {
9+
printf("The %s wonders when it will get to move.", ai->owner->name);
10+
}

src/components/ai.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// Created by Saturnation on 4/11/2018.
3+
//
4+
5+
#ifndef LIBTCOD_TUTORIAL_AI_H
6+
#define LIBTCOD_TUTORIAL_AI_H
7+
8+
#include "../entity.h"
9+
10+
typedef struct {
11+
entity *owner;
12+
} ai;
13+
14+
void take_turn(ai *ai);
15+
16+
#endif //LIBTCOD_TUTORIAL_AI_H

src/components/fighter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Created by Doug on 4/11/2018.
2+
// Created by Saturnation on 4/11/2018.
33
//
44

55
#include "fighter.h"

src/components/fighter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Created by Doug on 4/11/2018.
2+
// Created by Saturnation on 4/11/2018.
33
//
44

55
#ifndef LIBTCOD_TUTORIAL_FIGHTER_H

src/data/enums.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Created by Doug on 3/11/2018.
2+
// Created by Saturnation on 3/11/2018.
33
//
44

55
#ifndef LIBTCOD_TUTORIAL_ENUMS_H

src/data/list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Created by Doug on 3/11/2018.
2+
// Created by Saturnation on 3/11/2018.
33
//
44

55
#ifndef LIBTCOD_TUTORIAL_LIST_H

0 commit comments

Comments
 (0)