Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

taglist hinzugefuegt

  • Loading branch information...
commit 0615a85c8d59c5fdda036745661ab60015517640 1 parent f71d6cc
Michael Markowski authored
View
2  AFGameEditor.h
@@ -70,5 +70,7 @@ enum {
- (IBAction)removeSelectedLevels:(id)sender;
- (NSArray *)sortDescriptors;
- (NSDictionary*)texturesForAtlasNamed:(NSString*)name;
+- (IBAction)addNewSpriteSheet:(id)sender;
+- (IBAction)removeSelectedSpriteSheets:(id)sender;
@end
View
22 AFGameEditor.m
@@ -297,6 +297,28 @@ - (IBAction)removeSelectedLayers:(id)sender
[helper renumberViewPositions];
}
+- (IBAction)addNewSpriteSheet:(id)sender {
+ TextureAtlas *newTextureAtlas = [NSEntityDescription insertNewObjectForEntityForName:@"TextureAtlas"
+ inManagedObjectContext:[self managedObjectContext]];
+ newTextureAtlas.name = @"New SpriteSheet";
+ newTextureAtlas.game = game;
+// NSMutableSet *gameSpriteSheets = [self.game valueForKey:@"textureAtlases"];
+// [gameSpriteSheets addObject:newTextureAtlas];
+// [self.game setValue:gameSpriteSheets forKey:@"textureAtlases"];
+}
+
+- (IBAction)removeSelectedSpriteSheets:(id)sender
+{
+ NSArray *selectedTextureAtlases = [textureAtlasArrayController selectedObjects];
+ int count;
+ for( count = 0; count < [selectedTextureAtlases count]; count ++ )
+ {
+ NSManagedObject *currentObject = [selectedTextureAtlases objectAtIndex:count];
+ [[self managedObjectContext] deleteObject:currentObject];
+ }
+}
+
+
- (NSArray *)sortDescriptors {
if( _sortDescriptors == nil ) {
_sortDescriptors = [NSArray arrayWithObject:[[NSSortDescriptor alloc] initWithKey:@"viewPosition" ascending:YES]];
View
12,567 English.lproj/GameEditor.xib
7,563 additions, 5,004 deletions not shown
View
1  Game.h
@@ -22,5 +22,6 @@
@property (nonatomic, retain) NSSet* levels;
@property (nonatomic, retain) NSSet* textureAtlases;
@property (nonatomic, retain) NSNumber * showBoundsInEditor;
+@property (nonatomic, retain) NSSet * highscores;
@end
View
2  Game.m
@@ -15,6 +15,6 @@ @implementation Game
@implementation Game (CoreDataGeneratedAccessors)
-@dynamic showGridInEditor, levels, textureAtlases, showBoundsInEditor;
+@dynamic showGridInEditor, levels, textureAtlases, showBoundsInEditor, highscores;
@end
View
2  Game.xcdatamodeld/.xccurrentversion
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
- <string>Game0.2.xcdatamodel</string>
+ <string>Game0.5.xcdatamodel</string>
</dict>
</plist>
View
BIN  Game.xcdatamodeld/Game0.3.xcdatamodel/elements
Binary file not shown
View
BIN  Game.xcdatamodeld/Game0.3.xcdatamodel/layout
Binary file not shown
View
445 Game.xcdatamodeld/Game0.3.xcmappingmodel/xcmapping.xml
445 additions, 0 deletions not shown
View
BIN  Game.xcdatamodeld/Game0.4.xcdatamodel/elements
Binary file not shown
View
BIN  Game.xcdatamodeld/Game0.4.xcdatamodel/layout
Binary file not shown
View
450 Game.xcdatamodeld/Game0.4.xcmappingmodel/xcmapping.xml
450 additions, 0 deletions not shown
View
BIN  Game.xcdatamodeld/Game0.5.xcdatamodel/elements
Binary file not shown
View
BIN  Game.xcdatamodeld/Game0.5.xcdatamodel/layout
Binary file not shown
View
471 Game.xcdatamodeld/Game0.5.xcmappingmodel/xcmapping.xml
471 additions, 0 deletions not shown
View
7,672 LevelEditor.xcodeproj/mic.pbxuser
6,827 additions, 845 deletions not shown
View
124 LevelEditor.xcodeproj/mic.perspectivev3
@@ -231,6 +231,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -255,7 +257,7 @@
<dict>
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
- <real>256</real>
+ <real>347</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
@@ -268,10 +270,11 @@
<array>
<string>2A37F4AAFDCFA73011CA2CEA</string>
<string>E1B74B1A0667B4A90069E3BA</string>
- <string>0519AF9B111D8648002FF48E</string>
+ <string>0519B57C111FF61C002FF48E</string>
<string>2A37F4ABFDCFA73011CA2CEA</string>
<string>05310945110F5FBC00DEB1DF</string>
<string>05310944110F5FB300DEB1DF</string>
+ <string>05F03F0710C47B0900EC70FA</string>
<string>2A37F4B8FDCFA73011CA2CEA</string>
<string>2F7446A90DB6BCF400F9684A</string>
<string>2A37F4C3FDCFA73011CA2CEA</string>
@@ -285,14 +288,14 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>22</integer>
- <integer>18</integer>
- <integer>6</integer>
+ <integer>8</integer>
+ <integer>2</integer>
+ <integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {256, 1064}}</string>
+ <string>{{0, 0}, {347, 1064}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -302,32 +305,30 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {273, 1082}}</string>
+ <string>{{0, 0}, {364, 1082}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
- <real>256</real>
+ <real>347</real>
</array>
<key>RubberWindowFrame</key>
- <string>43 55 1878 1123 0 0 1920 1178 </string>
+ <string>425 -126 1878 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>273pt</string>
+ <string>364pt</string>
</dict>
<dict>
<key>Dock</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>0597666510B7028B00AA52F8</string>
<key>PBXProjectModuleLabel</key>
- <string>LevelView.m</string>
+ <string>Game0.5.xcdatamodel</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -335,18 +336,17 @@
<key>PBXProjectModuleGUID</key>
<string>0597666610B7028B00AA52F8</string>
<key>PBXProjectModuleLabel</key>
- <string>LevelView.m</string>
+ <string>Game0.5.xcdatamodel</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>0519B322111F4373002FF48E</string>
+ <string>053E47131127080400640048</string>
<key>history</key>
<array>
<string>0541CE1810B965D60044DE1D</string>
<string>0541CE1910B965D60044DE1D</string>
<string>05F03F6A10C4818600EC70FA</string>
<string>05F03F9D10C4847A00EC70FA</string>
- <string>05A7A0B410D6A58B001319E2</string>
<string>05A7A0B510D6A58B001319E2</string>
<string>05A7A0BA10D6A58B001319E2</string>
<string>05A7A0BB10D6A58B001319E2</string>
@@ -355,15 +355,9 @@
<string>05A7A1B610D714AE001319E2</string>
<string>05A7A1C410D71707001319E2</string>
<string>05B22BCD10DA38910049542C</string>
- <string>05B22E8C10DB974C0049542C</string>
- <string>0580CB1E110771130054A9CE</string>
<string>0580CB1F110771130054A9CE</string>
- <string>0580CB81110775400054A9CE</string>
- <string>0580CB82110775400054A9CE</string>
<string>0580CB83110775400054A9CE</string>
<string>0580CB84110775400054A9CE</string>
- <string>0588EF461107E02E00D4B870</string>
- <string>0588EF471107E02E00D4B870</string>
<string>054847C3110D1AF600F6D3C6</string>
<string>0531095A110F624600DEB1DF</string>
<string>05310973110F964100DEB1DF</string>
@@ -372,7 +366,6 @@
<string>050E8F1A1110F24D00162A44</string>
<string>050E8F2B1110F64700162A44</string>
<string>050E8F2D1110F64700162A44</string>
- <string>051C55B51111163800CED300</string>
<string>050CE1CE111306F60031ED86</string>
<string>050CE21711130C670031ED86</string>
<string>050CE5521114AC0E0031ED86</string>
@@ -385,7 +378,6 @@
<string>050CE842111514220031ED86</string>
<string>050CE85D11151C130031ED86</string>
<string>050CE94C1115E84E0031ED86</string>
- <string>050CE9DB1115F4F00031ED86</string>
<string>050CEC011116159F0031ED86</string>
<string>050CEC4C11161DED0031ED86</string>
<string>050CEC8D111626590031ED86</string>
@@ -401,17 +393,30 @@
<string>05BC735E111859C1002662F1</string>
<string>0529D4991119B1E70048B6B9</string>
<string>052E6826111AC7F30092CFF4</string>
- <string>052E6EBA111C413A0092CFF4</string>
- <string>052E6EBB111C413A0092CFF4</string>
<string>052E6ECB111C435D0092CFF4</string>
<string>0519B063111E0BFB002FF48E</string>
- <string>0519B1F9111EEBEB002FF48E</string>
- <string>0519B2CC111F3C26002FF48E</string>
<string>0519B2EA111F3F7B002FF48E</string>
<string>0519B2EB111F3F7B002FF48E</string>
- <string>0519B303111F4057002FF48E</string>
- <string>0519B304111F4057002FF48E</string>
- <string>0519B316111F4229002FF48E</string>
+ <string>0519B566111FF4F4002FF48E</string>
+ <string>0542DF9C1122808900C22992</string>
+ <string>056ECB3211241D32007D02B8</string>
+ <string>053E3E121124C13B00640048</string>
+ <string>053E3EB51124CB3700640048</string>
+ <string>053E3EC21124CBC200640048</string>
+ <string>053E467D1126FBC000640048</string>
+ <string>053E46801126FBC000640048</string>
+ <string>053E46811126FBC000640048</string>
+ <string>053E46821126FBC000640048</string>
+ <string>053E46831126FBC000640048</string>
+ <string>053E46841126FBC000640048</string>
+ <string>053E46851126FBC000640048</string>
+ <string>053E46861126FBC000640048</string>
+ <string>053E46891126FBC000640048</string>
+ <string>053E469A1126FC8D00640048</string>
+ <string>053E469B1126FC8D00640048</string>
+ <string>053E469C1126FC8D00640048</string>
+ <string>053E47111127080400640048</string>
+ <string>053E47121127080400640048</string>
</array>
</dict>
<key>SplitCount</key>
@@ -425,18 +430,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1600, 792}}</string>
+ <string>{{0, 0}, {1509, 736}}</string>
<key>RubberWindowFrame</key>
- <string>43 55 1878 1123 0 0 1920 1178 </string>
+ <string>425 -126 1878 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>792pt</string>
+ <string>736pt</string>
</dict>
<dict>
<key>Proportion</key>
- <string>285pt</string>
+ <string>341pt</string>
<key>Tabs</key>
<array>
<dict>
@@ -450,7 +455,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {1600, 258}}</string>
+ <string>{{10, 27}, {1509, 138}}</string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
@@ -466,7 +471,9 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {1600, 258}}</string>
+ <string>{{10, 27}, {1509, 314}}</string>
+ <key>RubberWindowFrame</key>
+ <string>425 -126 1878 1123 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
@@ -504,9 +511,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {1600, 258}}</string>
- <key>RubberWindowFrame</key>
- <string>43 55 1878 1123 0 0 1920 1178 </string>
+ <string>{{10, 27}, {1600, 270}}</string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -515,7 +520,7 @@
</dict>
</array>
<key>Proportion</key>
- <string>1600pt</string>
+ <string>1509pt</string>
</dict>
</array>
<key>Name</key>
@@ -534,11 +539,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>0519AF88111D84E2002FF48E</string>
+ <string>053E3DD11124BEA500640048</string>
<string>1CA23ED40692098700951B8B</string>
- <string>0519AF89111D84E2002FF48E</string>
+ <string>053E3DD21124BEA500640048</string>
<string>0597666510B7028B00AA52F8</string>
- <string>0519AF8A111D84E2002FF48E</string>
+ <string>053E3DD31124BEA500640048</string>
<string>1CA23EDF0692099D00951B8B</string>
<string>1CA23EE00692099D00951B8B</string>
<string>1CA23EE10692099D00951B8B</string>
@@ -613,8 +618,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {913, 263}}</string>
- <string>{{913, 0}, {965, 263}}</string>
+ <string>{{0, 0}, {920, 80}}</string>
+ <string>{{920, 0}, {958, 80}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
@@ -629,8 +634,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {1878, 263}}</string>
- <string>{{0, 263}, {1878, 500}}</string>
+ <string>{{0, 0}, {1878, 80}}</string>
+ <string>{{0, 80}, {1878, 683}}</string>
</array>
</dict>
</dict>
@@ -660,10 +665,10 @@
<string>Value</string>
<real>85</real>
<string>Summary</string>
- <real>523</real>
+ <real>516</real>
</array>
<key>Frame</key>
- <string>{{913, 0}, {965, 263}}</string>
+ <string>{{920, 0}, {958, 80}}</string>
</dict>
</dict>
<key>Module</key>
@@ -687,13 +692,13 @@
</array>
<key>TableOfContents</key>
<array>
- <string>0519AF8B111D84E2002FF48E</string>
+ <string>053E3DD41124BEA500640048</string>
<string>1CCC7628064C1048000F2A68</string>
<string>1CCC7629064C1048000F2A68</string>
- <string>0519AF8C111D84E2002FF48E</string>
- <string>0519AF8D111D84E2002FF48E</string>
- <string>0519AF8E111D84E2002FF48E</string>
- <string>0519AF8F111D84E2002FF48E</string>
+ <string>053E3DD51124BEA500640048</string>
+ <string>053E3DD61124BEA500640048</string>
+ <string>053E3DD71124BEA500640048</string>
+ <string>053E3DD81124BEA500640048</string>
<string>0597666510B7028B00AA52F8</string>
</array>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
@@ -728,12 +733,13 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>0519AF90111D84E2002FF48E</string>
- <string>0519AF91111D84E2002FF48E</string>
+ <string>053E47141127080400640048</string>
+ <string>053E3DD91124BEA500640048</string>
+ <string>053E3DDA1124BEA500640048</string>
<string>/Users/mic/Documents/Xcode Projects/LevelEditor/LevelEditor.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>43 55 1878 1123 0 0 1920 1178 </string>
+ <string>425 -126 1878 1123 0 0 1920 1178 </string>
<key>WindowToolsV3</key>
<array>
<dict>
@@ -1106,7 +1112,7 @@
<key>TableOfContents</key>
<array>
<string>1C530D5B069F1CE1000CFCEE</string>
- <string>050CF3991117C4710031ED86</string>
+ <string>056ECB9111242C8D007D02B8</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
View
42 LevelEditor.xcodeproj/project.pbxproj
@@ -15,12 +15,14 @@
050E8CF411102B0E00162A44 /* TextureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 050E8CF311102B0E00162A44 /* TextureController.m */; };
050E8E421110AABC00162A44 /* TextureController+Browser.m in Sources */ = {isa = PBXBuildFile; fileRef = 050E8E411110AABC00162A44 /* TextureController+Browser.m */; };
050E8F261110F59300162A44 /* EditModeAwareCursor.m in Sources */ = {isa = PBXBuildFile; fileRef = 050E8F251110F59300162A44 /* EditModeAwareCursor.m */; };
- 0519AF9C111D8648002FF48E /* Game.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0519AF9B111D8648002FF48E /* Game.xcdatamodeld */; };
- 0519B1EB111EEB13002FF48E /* Game0.1-0.2.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 0519B1EA111EEB13002FF48E /* Game0.1-0.2.xcmappingmodel */; };
+ 0519B580111FF61C002FF48E /* Game.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0519B57C111FF61C002FF48E /* Game.xcdatamodeld */; };
05310930110F528E00DEB1DF /* btDraw.png in Resources */ = {isa = PBXBuildFile; fileRef = 0531092E110F528E00DEB1DF /* btDraw.png */; };
05310931110F528E00DEB1DF /* btMoveAndDrag.png in Resources */ = {isa = PBXBuildFile; fileRef = 0531092F110F528E00DEB1DF /* btMoveAndDrag.png */; };
05310948110F5FF300DEB1DF /* LevelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05310947110F5FF300DEB1DF /* LevelViewController.m */; };
05310972110F95CF00DEB1DF /* btSelect.png in Resources */ = {isa = PBXBuildFile; fileRef = 05310971110F95CF00DEB1DF /* btSelect.png */; };
+ 053E3E081124C0D300640048 /* Game0.4.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 053E3E071124C0D300640048 /* Game0.4.xcmappingmodel */; };
+ 053E46701126F81D00640048 /* TagValueToTagObjectTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 053E466F1126F81D00640048 /* TagValueToTagObjectTransformer.m */; };
+ 053E46961126FC7F00640048 /* Game0.5.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 053E46951126FC7F00640048 /* Game0.5.xcmappingmodel */; };
0541D0DD10BA25010044DE1D /* LevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0541D0DC10BA25010044DE1D /* LevelView.m */; };
0572206010C3101D00404A16 /* Layer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0572205F10C3101D00404A16 /* Layer.m */; };
0580CAEE11076D2A0054A9CE /* ImageToPNGDataTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0580CAED11076D2A0054A9CE /* ImageToPNGDataTransformer.m */; };
@@ -81,13 +83,20 @@
050E8E411110AABC00162A44 /* TextureController+Browser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TextureController+Browser.m"; sourceTree = "<group>"; };
050E8F241110F59300162A44 /* EditModeAwareCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditModeAwareCursor.h; sourceTree = "<group>"; };
050E8F251110F59300162A44 /* EditModeAwareCursor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EditModeAwareCursor.m; sourceTree = "<group>"; };
- 0519AF9D111D8648002FF48E /* Game0.2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Game0.2.xcdatamodel; sourceTree = "<group>"; };
- 0519B1EA111EEB13002FF48E /* Game0.1-0.2.xcmappingmodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcmappingmodel; path = "Game0.1-0.2.xcmappingmodel"; sourceTree = "<group>"; };
+ 0519B57D111FF61C002FF48E /* Game0.1.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = Game0.1.xcdatamodel; sourceTree = "<group>"; };
+ 0519B57E111FF61C002FF48E /* Game0.2.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = Game0.2.xcdatamodel; sourceTree = "<group>"; };
+ 0519B57F111FF61C002FF48E /* Game0.3.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = Game0.3.xcdatamodel; sourceTree = "<group>"; };
0531092E110F528E00DEB1DF /* btDraw.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = btDraw.png; path = Resources/btDraw.png; sourceTree = "<group>"; };
0531092F110F528E00DEB1DF /* btMoveAndDrag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = btMoveAndDrag.png; path = Resources/btMoveAndDrag.png; sourceTree = "<group>"; };
05310946110F5FF300DEB1DF /* LevelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelViewController.h; sourceTree = "<group>"; };
05310947110F5FF300DEB1DF /* LevelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LevelViewController.m; sourceTree = "<group>"; };
05310971110F95CF00DEB1DF /* btSelect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = btSelect.png; path = Resources/btSelect.png; sourceTree = "<group>"; };
+ 053E3E061124C08A00640048 /* Game0.4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Game0.4.xcdatamodel; sourceTree = "<group>"; };
+ 053E3E071124C0D300640048 /* Game0.4.xcmappingmodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcmappingmodel; path = Game0.4.xcmappingmodel; sourceTree = "<group>"; };
+ 053E462C1126EDB400640048 /* Game0.5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Game0.5.xcdatamodel; sourceTree = "<group>"; };
+ 053E466E1126F81D00640048 /* TagValueToTagObjectTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagValueToTagObjectTransformer.h; sourceTree = "<group>"; };
+ 053E466F1126F81D00640048 /* TagValueToTagObjectTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TagValueToTagObjectTransformer.m; sourceTree = "<group>"; };
+ 053E46951126FC7F00640048 /* Game0.5.xcmappingmodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcmappingmodel; path = Game0.5.xcmappingmodel; sourceTree = "<group>"; };
0541D0DB10BA25010044DE1D /* LevelView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelView.h; sourceTree = "<group>"; };
0541D0DC10BA25010044DE1D /* LevelView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LevelView.m; sourceTree = "<group>"; };
0541D12210BA27C30044DE1D /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = "<group>"; };
@@ -136,7 +145,6 @@
2F7446A80DB6BCF400F9684A /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
2F7446AA0DB6BCF400F9684A /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/GameEditor.xib; sourceTree = "<group>"; };
32DBCF750370BD2300C91783 /* LevelEditor_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LevelEditor_Prefix.pch; sourceTree = "<group>"; };
- 775BDEF0067A8BF0009058FE /* Game0.1.xcdatamodel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = wrapper.xcdatamodel; path = Game0.1.xcdatamodel; sourceTree = "<group>"; };
7788DA0506752A1600599AAD /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
8D15AC360486D014006FF6A4 /* LevelEditor-Info.plist */ = {isa = PBXFileReference; explicitFileType = text.plist.xml; fileEncoding = 4; path = "LevelEditor-Info.plist"; sourceTree = "<group>"; };
8D15AC370486D014006FF6A4 /* LevelEditor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LevelEditor.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -199,6 +207,8 @@
05F03F8010C482C700EC70FA /* NumberToColorTransformer.m */,
05A7A09910D6A27C001319E2 /* NSImage+Additions.h */,
05A7A09A10D6A27C001319E2 /* NSImage+Additions.m */,
+ 053E466E1126F81D00640048 /* TagValueToTagObjectTransformer.h */,
+ 053E466F1126F81D00640048 /* TagValueToTagObjectTransformer.m */,
);
name = Util;
sourceTree = "<group>";
@@ -319,7 +329,7 @@
E1B74B1A0667B4A90069E3BA /* Models */ = {
isa = PBXGroup;
children = (
- 0519AF9B111D8648002FF48E /* Game.xcdatamodeld */,
+ 0519B57C111FF61C002FF48E /* Game.xcdatamodeld */,
);
name = Models;
sourceTree = "<group>";
@@ -389,7 +399,6 @@
files = (
8D15AC310486D014006FF6A4 /* AFGameEditor.m in Sources */,
8D15AC320486D014006FF6A4 /* main.m in Sources */,
- 0519AF9C111D8648002FF48E /* Game.xcdatamodeld in Sources */,
05AF3D9B10B745FD00650F15 /* TextureAtlasView.m in Sources */,
0541D0DD10BA25010044DE1D /* LevelView.m in Sources */,
05A9061310BC56F8002F616A /* Model.m in Sources */,
@@ -415,7 +424,10 @@
050CE204111309FD0031ED86 /* SimpleNodeData.m in Sources */,
050CE20711130AD50031ED86 /* SpriteType.m in Sources */,
050CE8D11115BABE0031ED86 /* ImageAndTextCell.m in Sources */,
- 0519B1EB111EEB13002FF48E /* Game0.1-0.2.xcmappingmodel in Sources */,
+ 0519B580111FF61C002FF48E /* Game.xcdatamodeld in Sources */,
+ 053E3E081124C0D300640048 /* Game0.4.xcmappingmodel in Sources */,
+ 053E46701126F81D00640048 /* TagValueToTagObjectTransformer.m in Sources */,
+ 053E46961126FC7F00640048 /* Game0.5.xcmappingmodel in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -549,14 +561,18 @@
/* End XCConfigurationList section */
/* Begin XCVersionGroup section */
- 0519AF9B111D8648002FF48E /* Game.xcdatamodeld */ = {
+ 0519B57C111FF61C002FF48E /* Game.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
- 775BDEF0067A8BF0009058FE /* Game0.1.xcdatamodel */,
- 0519AF9D111D8648002FF48E /* Game0.2.xcdatamodel */,
- 0519B1EA111EEB13002FF48E /* Game0.1-0.2.xcmappingmodel */,
+ 0519B57D111FF61C002FF48E /* Game0.1.xcdatamodel */,
+ 0519B57E111FF61C002FF48E /* Game0.2.xcdatamodel */,
+ 0519B57F111FF61C002FF48E /* Game0.3.xcdatamodel */,
+ 053E3E061124C08A00640048 /* Game0.4.xcdatamodel */,
+ 053E3E071124C0D300640048 /* Game0.4.xcmappingmodel */,
+ 053E462C1126EDB400640048 /* Game0.5.xcdatamodel */,
+ 053E46951126FC7F00640048 /* Game0.5.xcmappingmodel */,
);
- currentVersion = 0519AF9D111D8648002FF48E /* Game0.2.xcdatamodel */;
+ currentVersion = 053E462C1126EDB400640048 /* Game0.5.xcdatamodel */;
path = Game.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
View
16 TagValueToTagObjectTransformer.h
@@ -0,0 +1,16 @@
+//
+// TagValueToTagObjectTransformer.h
+// LevelEditor
+//
+// Created by Michael Markowski on 13.02.10.
+// Copyright 2010 Artifacts. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface TagValueToTagObjectTransformer : NSObject {
+
+}
+
+@end
View
47 TagValueToTagObjectTransformer.m
@@ -0,0 +1,47 @@
+//
+// TagValueToTagObjectTransformer.m
+// LevelEditor
+//
+// Created by Michael Markowski on 13.02.10.
+// Copyright 2010 Artifacts. All rights reserved.
+//
+
+#import "TagValueToTagObjectTransformer.h"
+#import "AFGameEditor.h"
+
+@implementation TagValueToTagObjectTransformer
+
++ (BOOL)allowsReverseTransformation {
+ return YES;
+}
+
++ (Class)transformedValueClass {
+ return [NSManagedObject class];
+}
+
+
+- (id)transformedValue:(id)value {
+ AFGameEditor *doc = (AFGameEditor*)[[NSDocumentController sharedDocumentController] currentDocument];
+ NSManagedObjectContext *managedObjectContext = doc.managedObjectContext;
+ NSFetchRequest *request = [[NSFetchRequest alloc] init];
+ NSEntityDescription *entity = [NSEntityDescription entityForName:@"Tag" inManagedObjectContext:managedObjectContext];
+ [request setEntity:entity];
+ // retrive the objects with a given value for a certain property
+ NSPredicate *predicate = [NSPredicate predicateWithFormat: @"tagValue == %@", value];
+ [request setPredicate:predicate];
+ NSError *error = nil;
+ NSArray *result = [managedObjectContext executeFetchRequest:request error:&error];
+ [request release];
+ if ([result count]==0) return nil;
+ return [result objectAtIndex:0];
+}
+
+
+- (id)reverseTransformedValue:(id)value {
+ NSManagedObject *obj = value;
+ NSNumber *number = [obj valueForKey:@"tagValue"];
+// NSInteger tagValue = [number integerValue];
+ return number;
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.