Commits

Allan Davis  committed 0b9aa06

added properties to entity

  • Participants
  • Parent commits 21fd206

Comments (0)

Files changed (6)

File code/HuntTheWumpus/HuntTheWumpus.xcodeproj/project.pbxproj

 		CED42A18161947C5008E24E7 /* Player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Player.h; sourceTree = "<group>"; };
 		CED42A19161947C5008E24E7 /* Player.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Player.m; sourceTree = "<group>"; };
 		CED42A1C16194831008E24E7 /* PlayerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlayerSpec.m; sourceTree = "<group>"; };
+		CED42A1E161A9453008E24E7 /* GameLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameLocation.h; path = helpers/GameLocation.h; sourceTree = "<group>"; };
 		ECD265712D6D4BA3A3C19E38 /* Pods-test.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-test.xcconfig"; path = "Pods/Pods-test.xcconfig"; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
 
 			children = (
 				CED42A13161800D2008E24E7 /* ADInput.h */,
 				CED42A14161800D2008E24E7 /* ADInput.m */,
+				CED42A1E161A9453008E24E7 /* GameLocation.h */,
 			);
 			name = helpers;
 			sourceTree = "<group>";

File code/HuntTheWumpus/HuntTheWumpus/helpers/GameLocation.h

+//
+//  GameLocation.h
+//  HuntTheWumpus
+//
+//  Created by Allan Davis on 10/1/12.
+//  Copyright (c) 2012 Cajun Code. All rights reserved.
+//
+
+#ifndef HuntTheWumpus_GameLocation_h
+#define HuntTheWumpus_GameLocation_h
+struct GamePoint{
+    int x;
+    int y;
+};
+
+#endif

File code/HuntTheWumpus/HuntTheWumpus/models/Entity.h

 //
 
 #import <Foundation/Foundation.h>
+#import "GameLocation.h"
 
 @interface Entity : NSObject
-
+@property struct GamePoint *location;
+@property int hitPoints;
+@property int lifePoints;
 @end

File code/HuntTheWumpus/HuntTheWumpusTests/EntitySpec.m

 
 SPEC_BEGIN(EntitySpec)
     describe(@"Entity", ^{
-        context(@"existance", ^{
-            it(@"should be creatiable", ^{
-                
-            });
+        __block Entity *entity;
+        beforeAll(^{
+            entity = [[Entity alloc] init];
         });
-        it(@"should do somthing", ^{
-            
+        it(@"should keep track of it's x Coordinate", ^{
+            entity.location->x = 1;
+            [[theValue(entity.location->x) should] equal:theValue(1)];
+        });
+        it(@"should keep track of it's y Coordinate", ^{
+            entity.location->y = 1;
+            [[theValue(entity.location->y) should] equal:theValue(1)];
+        });
+        it(@"should keep trakc of it's hit points", ^{
+            entity.hitPoints = 20;
+            [[theValue(entity.hitPoints) should] equal: theValue(20)];
+        });
+        it(@"should keep track of it's life points", ^{
+            entity.lifePoints = 500;
+            [[theValue(entity.lifePoints) should] equal: theValue(500)];
         });
     });
 SPEC_END

File code/HuntTheWumpus/HuntTheWumpusTests/PlayerSpec.m

             player.name = @"Allan";
             [[player.name should] equal: @"Allan"];
         });
-        pending(@"should keep track of it hit points", ^{});
+        pending_(@"should keep track of it hit points", ^{});
         
         describe(@"preformAction", ^{
             it(@"Should respond with I can't do this if it cannot respond to the action", ^{

File presentations/huntWumpus.odp

Binary file modified.