This commit is contained in:
Saturneric 2020-09-01 00:11:47 +08:00
parent 7e65fdf0bb
commit 4fa6da063c
11 changed files with 286 additions and 0 deletions

14
Algorithm.h Normal file
View File

@ -0,0 +1,14 @@
//
// Algorithm.h
// GodEngine
//
// Created by Saturneric on 17/1/29.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
@interface findByString : NSObject
@property(nonatomic)NSString *targetName;
@property(nonatomic)NSArray *targetArray;
@end

24
Effect.h Normal file
View File

@ -0,0 +1,24 @@
//
// Effect.h
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
#import "Engine.h"
@interface GEEffect : NSObject
@property(nonatomic)NSSet *requireObjectType;
@property(nonatomic)NSSet *requirePropertyName;
@property(nonatomic)id function;
- (void)setRequireObjectType:(NSSet *)requireObjectType;
- (void)addRequireObjectType:(NSSet *)typeName;
- (void)setRequireObject:(NSSet *)objects;
- (void)setFunction:(id)function;
- (void)startMeasure;
@end

9
Effect.m Normal file
View File

@ -0,0 +1,9 @@
//
// Effect.m
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017 Bakantu Eric. All rights reserved.
//
#import "Effect.h"

10
Engine.h Normal file
View File

@ -0,0 +1,10 @@
//
// Engine.h
// GodEngine
//
// Created by Saturneric on 17/1/29.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Algorithm.h"

82
Object.h Normal file
View File

@ -0,0 +1,82 @@
//
// Object.h
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
#import "Engine.h"
#define VECTOR 0
#define SCARLAR 1
@interface GEUniverse : NSObject
@property(nonatomic)NSSet *specialPropertyList;
@property(nonatomic)NSString *universeID;
@property(nonatomic)NSArray *objects;
@end
@interface GEObjectGroup : NSObject
@property(nonatomic)NSSet *defaultPropertyList;
@end
@interface GEProperty : NSObject
@property(nonatomic) NSString *name;
@property(nonatomic) NSInteger type;
@property(nonatomic) id variable;
- (void)setPropertyName:(NSString *)name;
- (void)setPropertyVariable:(NSInteger)type variable:(id) variable;
@end
@interface GEVector : NSObject
@property(assign,nonatomic) NSInteger demention;
@property(nonatomic) NSArray *describtion;
- (void)setDemention:(NSInteger)dementionNumber;
- (void)setVectorValue:(NSInteger)demention value:(NSSwappedDouble)value;
- (void)setVectorValues:(NSArray *) describtion;
- (NSSwappedDouble *)getVectorValue:(NSInteger) demention;
- (NSArray *)getVectorValues;
@end
@interface GEScalar : NSObject
@property(nonatomic) NSSwappedDouble value;
- (void)setScalarValue:(NSSwappedDouble)value;
- (NSSwappedDouble)getScalarValue;
@end
@interface GEObject : NSObject
@property(nonatomic) NSDictionary *defaultProperty;
@property(nonatomic) NSDictionary *specialProperty;
@property(nonatomic) NSString *type;
@property(nonatomic) NSString *objectID;
@property(nonatomic) NSString *groupID;
@property(nonatomic) NSString *universeID;
@property(nonatomic) GEUniverse *container;
@property(nonatomic) GEObjectGroup *group;
- (GEProperty *)getDefultPropertyWithName:(NSString *)name;
- (GEProperty *)getSpecialPropertyWithName:(NSString *)name;
- (void)setSpecialProperty:(GEProperty *)property;
- (void)setDefultProperty:(GEProperty *)property;
- (void)addSpecialProperties:(NSDictionary *) properties;
- (void)addDefaultProperties:(NSDictionary *) properties;
- (void)initWithProperties:(NSDictionary *) properties universe:(GEUniverse *)container group:(GEObjectGroup *) group;
@end

45
Object.m Normal file
View File

@ -0,0 +1,45 @@
//
// Object.m
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017 Bakantu Eric. All rights reserved.
//
#import "Object.h"
@implementation GEObject
- (void)addDefultProperty:(GEProperty *)property{
}
- (void)initWithProperties:(NSDictionary *) properties universe:(GEUniverse *)container group:(GEObjectGroup *) group{
self.objectID = [[NSUUID UUID] UUIDString];
self.universeID = container.universeID;
self.container = container;
NSString *p_property = nil;
self.specialProperty = [[NSDictionary alloc] init];
for (p_property in container.specialPropertyList){
[self.specialProperty insertValue:[properties objectForKey:p_property] inPropertyWithKey:p_property];
}
for (p_property in group.defaultPropertyList){
[self.defaultProperty insertValue:[properties objectForKey:p_property] inPropertyWithKey:p_property];
}
}
-(GEProperty *)getSpecialPropertyWithName:(NSString *)name{
return [self.specialProperty objectForKey:name];
}
-(GEProperty *)getDefultPropertyWithName:(NSString *)name{
return [self.specialProperty objectForKey:name];
}
-(void)addSpecialProperty:(GEProperty *)property{
[self.specialProperty insertValue:<#(nonnull id)#> inPropertyWithKey:<#(nonnull NSString *)#>]
}
@end

41
Time.h Normal file
View File

@ -0,0 +1,41 @@
//
// Time.h
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
#import "Engine.h"
#import "Update.h"
@interface GETime : NSObject
@property(nonatomic) NSUInteger *moment;
@end
@interface GEPhoto : NSObject
@property (nonatomic)NSMutableArray *record;
@property (nonatomic)GETime* time;
@property (nonatomic)NSMutableArray *finalRecord;
@end
@interface GETimeLine : NSObject
@property(strong,nonatomic)NSMutableArray *line;
@property(strong,nonatomic)NSString *timeLineID;
@property(nonatomic)GEPhoto *linePhoto;
@property(nonatomic)NSInteger *precision;
@end
@interface GENowMonent : NSObject
@property(nonatomic)GEPhoto *thisPhoto;
@property(nonatomic)GETime *thisTime;
@property(nonatomic)GETimeLine *thisTimeLine;
@end

9
Time.m Normal file
View File

@ -0,0 +1,9 @@
//
// Time.m
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017 Bakantu Eric. All rights reserved.
//
#import "Time.h"

26
Update.h Normal file
View File

@ -0,0 +1,26 @@
//
// Update.h
// GodEngine
//
// Created by Saturneric on 17/1/29.
// Copyright © 2017年 Bakantu Eric. All rights reserved.
//
#import "Engine.h"
#import "Object.h"
@interface GEUpdate : NSObject
@property(nonatomic)NSArray *relatedObjectID;
@property(nonatomic)NSArray *changeAction;
@end
@interface GEAction : NSObject
@property(nonatomic)GEProperty *historyProperty;
@property(nonatomic)GEProperty *changedProperty;
@end

9
Update.m Normal file
View File

@ -0,0 +1,9 @@
//
// Update.m
// GodEngine
//
// Created by Saturneric on 17/1/29.
// Copyright © 2017 Bakantu Eric. All rights reserved.
//
#import "Update.h"

17
main.m Normal file
View File

@ -0,0 +1,17 @@
//
// main.m
// GodEngine
//
// Created by Saturneric on 17/1/25.
// Copyright © 2017 Bakantu Eric. All rights reserved.
//
#import "Engine.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
NSLog(@"Hello, World!");
}
return 0;
}