質問編集履歴

2

2017/05/06 17:04

投稿

ShuperDark
ShuperDark

スコア11

test CHANGED
File without changes
test CHANGED
@@ -11,6 +11,8 @@
11
11
 
12
12
 
13
13
  //DarkBowItem.cpp
14
+
15
+
14
16
 
15
17
  #include "DarkBowItem.h"
16
18
 

1

2017/05/06 17:04

投稿

ShuperDark
ShuperDark

スコア11

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,12 @@
1
1
  NDK: invalid use of incomplete type 'class UseDuration'というエラーに困っています...
2
2
 
3
3
  C++初心者なので何をすればいいのかわかりません!どなたか助けてください!お願いします。
4
+
5
+ ちなみにエラーの箇所は下記の「if(itemstack.getMaxUseDuration() >= 20) {」と、
6
+
7
+ 「if(itemstack.getMaxUseDuration() >= 10) {」、
8
+
9
+ 「if(itemstack.getMaxUseDuration() >= 0) {」に引かさっています。
4
10
 
5
11
 
6
12
 
@@ -37,3 +43,29 @@
37
43
  textures[2] = "dark_bow_pulling_2";
38
44
 
39
45
  }
46
+
47
+
48
+
49
+ bool DarkBowItem::use(ItemInstance& itemstack, Player& player) {
50
+
51
+ if(itemstack.getMaxUseDuration() >= 20) {
52
+
53
+ return setIcon(textures[0], 0);
54
+
55
+ }
56
+
57
+ if(itemstack.getMaxUseDuration() >= 10) {
58
+
59
+ return setIcon(textures[1], 1);
60
+
61
+ }
62
+
63
+ if(itemstack.getMaxUseDuration() >= 0) {
64
+
65
+ return setIcon(textures[2], 2);
66
+
67
+ }
68
+
69
+ return DarkBowItem::use(itemstack, player);
70
+
71
+ }