diff --git a/src/Catty/DataModel/Bricks/Arduino/ArduinoSendDigitalValueBrick.m b/src/Catty/DataModel/Bricks/Arduino/ArduinoSendDigitalValueBrick.m index a197fcf7f3..56eae8daf1 100644 --- a/src/Catty/DataModel/Bricks/Arduino/ArduinoSendDigitalValueBrick.m +++ b/src/Catty/DataModel/Bricks/Arduino/ArduinoSendDigitalValueBrick.m @@ -25,9 +25,9 @@ @implementation ArduinoSendDigitalValueBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kArduinoBrick; + return @[@(kArduinoBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Arduino/ArduinoSendPWMValueBrick.m b/src/Catty/DataModel/Bricks/Arduino/ArduinoSendPWMValueBrick.m index 8215f6f158..21eb5a1cd5 100644 --- a/src/Catty/DataModel/Bricks/Arduino/ArduinoSendPWMValueBrick.m +++ b/src/Catty/DataModel/Bricks/Arduino/ArduinoSendPWMValueBrick.m @@ -25,9 +25,9 @@ @implementation ArduinoSendPWMValueBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kArduinoBrick; + return @[@(kArduinoBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Control/BroadcastBrick.m b/src/Catty/DataModel/Bricks/Control/BroadcastBrick.m index 33bd4678cc..e44debd16b 100644 --- a/src/Catty/DataModel/Bricks/Control/BroadcastBrick.m +++ b/src/Catty/DataModel/Bricks/Control/BroadcastBrick.m @@ -26,9 +26,9 @@ @implementation BroadcastBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kControlBrick),@(kEventBrick)]; } - (id)initWithMessage:(NSString *)message diff --git a/src/Catty/DataModel/Bricks/Control/BroadcastWaitBrick.m b/src/Catty/DataModel/Bricks/Control/BroadcastWaitBrick.m index a3613b33cf..8fbe621b56 100644 --- a/src/Catty/DataModel/Bricks/Control/BroadcastWaitBrick.m +++ b/src/Catty/DataModel/Bricks/Control/BroadcastWaitBrick.m @@ -26,9 +26,9 @@ @implementation BroadcastWaitBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kControlBrick),@(kEventBrick)]; } - (id)initWithMessage:(NSString*)message diff --git a/src/Catty/DataModel/Bricks/Control/ForeverBrick.m b/src/Catty/DataModel/Bricks/Control/ForeverBrick.m index d6cc0b3952..220f47dfc5 100644 --- a/src/Catty/DataModel/Bricks/Control/ForeverBrick.m +++ b/src/Catty/DataModel/Bricks/Control/ForeverBrick.m @@ -24,9 +24,9 @@ @implementation ForeverBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isAnimateable diff --git a/src/Catty/DataModel/Bricks/Control/IfLogicBeginBrick.m b/src/Catty/DataModel/Bricks/Control/IfLogicBeginBrick.m index 762ab0a63a..b0d9f88002 100644 --- a/src/Catty/DataModel/Bricks/Control/IfLogicBeginBrick.m +++ b/src/Catty/DataModel/Bricks/Control/IfLogicBeginBrick.m @@ -28,9 +28,9 @@ @implementation IfLogicBeginBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isAnimateable diff --git a/src/Catty/DataModel/Bricks/Control/IfLogicElseBrick.m b/src/Catty/DataModel/Bricks/Control/IfLogicElseBrick.m index 67615546ef..52a93a7350 100644 --- a/src/Catty/DataModel/Bricks/Control/IfLogicElseBrick.m +++ b/src/Catty/DataModel/Bricks/Control/IfLogicElseBrick.m @@ -27,9 +27,9 @@ @implementation IfLogicElseBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isSelectableForObject diff --git a/src/Catty/DataModel/Bricks/Control/IfLogicEndBrick.m b/src/Catty/DataModel/Bricks/Control/IfLogicEndBrick.m index b594506012..4b1cc0a92f 100644 --- a/src/Catty/DataModel/Bricks/Control/IfLogicEndBrick.m +++ b/src/Catty/DataModel/Bricks/Control/IfLogicEndBrick.m @@ -28,9 +28,9 @@ @implementation IfLogicEndBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isSelectableForObject diff --git a/src/Catty/DataModel/Bricks/Control/IfThenLogicBeginBrick.m b/src/Catty/DataModel/Bricks/Control/IfThenLogicBeginBrick.m index ad86c4a7a8..89483b4061 100644 --- a/src/Catty/DataModel/Bricks/Control/IfThenLogicBeginBrick.m +++ b/src/Catty/DataModel/Bricks/Control/IfThenLogicBeginBrick.m @@ -27,9 +27,9 @@ @implementation IfThenLogicBeginBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isAnimateable diff --git a/src/Catty/DataModel/Bricks/Control/IfThenLogicEndBrick.m b/src/Catty/DataModel/Bricks/Control/IfThenLogicEndBrick.m index e4bb082b43..68bd488a6a 100644 --- a/src/Catty/DataModel/Bricks/Control/IfThenLogicEndBrick.m +++ b/src/Catty/DataModel/Bricks/Control/IfThenLogicEndBrick.m @@ -27,9 +27,9 @@ @implementation IfThenLogicEndBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isSelectableForObject diff --git a/src/Catty/DataModel/Bricks/Control/LoopEndBrick.m b/src/Catty/DataModel/Bricks/Control/LoopEndBrick.m index 9402590b9f..8e74ddbc0d 100644 --- a/src/Catty/DataModel/Bricks/Control/LoopEndBrick.m +++ b/src/Catty/DataModel/Bricks/Control/LoopEndBrick.m @@ -27,9 +27,9 @@ @implementation LoopEndBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isSelectableForObject diff --git a/src/Catty/DataModel/Bricks/Control/NoteBrick.m b/src/Catty/DataModel/Bricks/Control/NoteBrick.m index e72deadef8..2aa8ad2a7d 100644 --- a/src/Catty/DataModel/Bricks/Control/NoteBrick.m +++ b/src/Catty/DataModel/Bricks/Control/NoteBrick.m @@ -24,9 +24,9 @@ @implementation NoteBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject diff --git a/src/Catty/DataModel/Bricks/Control/RepeatBrick.m b/src/Catty/DataModel/Bricks/Control/RepeatBrick.m index 061b242574..9b3a6c1166 100644 --- a/src/Catty/DataModel/Bricks/Control/RepeatBrick.m +++ b/src/Catty/DataModel/Bricks/Control/RepeatBrick.m @@ -26,9 +26,9 @@ @implementation RepeatBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isLoopBrick diff --git a/src/Catty/DataModel/Bricks/Control/RepeatUntilBrick.m b/src/Catty/DataModel/Bricks/Control/RepeatUntilBrick.m index 7498c30d7c..2895f7f4fe 100644 --- a/src/Catty/DataModel/Bricks/Control/RepeatUntilBrick.m +++ b/src/Catty/DataModel/Bricks/Control/RepeatUntilBrick.m @@ -28,9 +28,9 @@ @interface RepeatUntilBrick() @implementation RepeatUntilBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isAnimateable diff --git a/src/Catty/DataModel/Bricks/Control/WaitBrick.m b/src/Catty/DataModel/Bricks/Control/WaitBrick.m index c5cf2893c5..a6d452683b 100644 --- a/src/Catty/DataModel/Bricks/Control/WaitBrick.m +++ b/src/Catty/DataModel/Bricks/Control/WaitBrick.m @@ -26,9 +26,9 @@ @implementation WaitBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Control/WaitUntilBrick.m b/src/Catty/DataModel/Bricks/Control/WaitUntilBrick.m index 451e9019f3..7d17fb73cf 100644 --- a/src/Catty/DataModel/Bricks/Control/WaitUntilBrick.m +++ b/src/Catty/DataModel/Bricks/Control/WaitUntilBrick.m @@ -28,9 +28,9 @@ @interface WaitUntilBrick() @implementation WaitUntilBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kControlBrick; + return @[@(kControlBrick)]; } - (BOOL)isAnimateable diff --git a/src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.m b/src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.m index 2d32a6cbc1..d90da7ef18 100644 --- a/src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.m +++ b/src/Catty/DataModel/Bricks/Data/AddItemToUserListBrick.m @@ -65,9 +65,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject } } -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Data/ChangeVariableBrick.m b/src/Catty/DataModel/Bricks/Data/ChangeVariableBrick.m index ec9bb2e763..9d3cb7de39 100644 --- a/src/Catty/DataModel/Bricks/Data/ChangeVariableBrick.m +++ b/src/Catty/DataModel/Bricks/Data/ChangeVariableBrick.m @@ -25,9 +25,9 @@ @implementation ChangeVariableBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.m b/src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.m index 910a8e9cdf..5dfbe1ba95 100644 --- a/src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.m +++ b/src/Catty/DataModel/Bricks/Data/DeleteItemOfUserListBrick.m @@ -28,9 +28,9 @@ @implementation DeleteItemOfUserListBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Data/HideTextBrick.m b/src/Catty/DataModel/Bricks/Data/HideTextBrick.m index bf10469ffd..ad05d0b797 100644 --- a/src/Catty/DataModel/Bricks/Data/HideTextBrick.m +++ b/src/Catty/DataModel/Bricks/Data/HideTextBrick.m @@ -26,9 +26,9 @@ @implementation HideTextBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (UserVariable*)variableForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Data/InsertItemIntoUserListBrick.m b/src/Catty/DataModel/Bricks/Data/InsertItemIntoUserListBrick.m index 545f71a941..8869a9864a 100644 --- a/src/Catty/DataModel/Bricks/Data/InsertItemIntoUserListBrick.m +++ b/src/Catty/DataModel/Bricks/Data/InsertItemIntoUserListBrick.m @@ -74,9 +74,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject } } -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Data/ReplaceItemInUserListBrick.m b/src/Catty/DataModel/Bricks/Data/ReplaceItemInUserListBrick.m index d0dd923359..a16dde82a3 100644 --- a/src/Catty/DataModel/Bricks/Data/ReplaceItemInUserListBrick.m +++ b/src/Catty/DataModel/Bricks/Data/ReplaceItemInUserListBrick.m @@ -74,9 +74,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject } } -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Data/SetVariableBrick.m b/src/Catty/DataModel/Bricks/Data/SetVariableBrick.m index 93200d4724..93368fd2ac 100644 --- a/src/Catty/DataModel/Bricks/Data/SetVariableBrick.m +++ b/src/Catty/DataModel/Bricks/Data/SetVariableBrick.m @@ -63,9 +63,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject } } -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Data/ShowTextBrick.m b/src/Catty/DataModel/Bricks/Data/ShowTextBrick.m index 97163905e7..b8e6780096 100644 --- a/src/Catty/DataModel/Bricks/Data/ShowTextBrick.m +++ b/src/Catty/DataModel/Bricks/Data/ShowTextBrick.m @@ -76,9 +76,9 @@ - (BOOL)allowsStringFormula{ return NO; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kDataBrick; + return @[@(kDataBrick),@(kLookBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Data/WebRequestBrick.swift b/src/Catty/DataModel/Bricks/Data/WebRequestBrick.swift index a469b650e5..d8f55ef0e4 100644 --- a/src/Catty/DataModel/Bricks/Data/WebRequestBrick.swift +++ b/src/Catty/DataModel/Bricks/Data/WebRequestBrick.swift @@ -41,8 +41,8 @@ self.script = script } - func category() -> kBrickCategoryType { - kBrickCategoryType.dataBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.dataBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/SewUpBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/SewUpBrick.swift index 41f1962cd1..b18b2e67ba 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/SewUpBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/SewUpBrick.swift @@ -27,8 +27,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber] { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StartRunningStitchBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StartRunningStitchBrick.swift index 6757a5dcac..f58ee1bc27 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StartRunningStitchBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StartRunningStitchBrick.swift @@ -32,8 +32,8 @@ import Foundation super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StartTripleStitchBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StartTripleStitchBrick.swift index d53e9df3d1..8c009a4a12 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StartTripleStitchBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StartTripleStitchBrick.swift @@ -32,8 +32,8 @@ import Foundation super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StartZigzagStitchBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StartZigzagStitchBrick.swift index a53a3a8b34..78650df148 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StartZigzagStitchBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StartZigzagStitchBrick.swift @@ -34,8 +34,8 @@ import Foundation super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StitchBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StitchBrick.swift index ba0c39b8e0..ada1259e08 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StitchBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StitchBrick.swift @@ -27,8 +27,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StitchThreadColorBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StitchThreadColorBrick.swift index da2466c169..809f132ddb 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StitchThreadColorBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StitchThreadColorBrick.swift @@ -38,8 +38,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Embroidery/StopCurrentStitchBrick.swift b/src/Catty/DataModel/Bricks/Embroidery/StopCurrentStitchBrick.swift index 3a22f732b9..da6efdf979 100644 --- a/src/Catty/DataModel/Bricks/Embroidery/StopCurrentStitchBrick.swift +++ b/src/Catty/DataModel/Bricks/Embroidery/StopCurrentStitchBrick.swift @@ -29,8 +29,8 @@ import Foundation super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.embroideryBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.embroideryBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/IO/FlashBrick.m b/src/Catty/DataModel/Bricks/IO/FlashBrick.m index 3dfc40049d..bf32efd5ae 100644 --- a/src/Catty/DataModel/Bricks/IO/FlashBrick.m +++ b/src/Catty/DataModel/Bricks/IO/FlashBrick.m @@ -24,9 +24,9 @@ @implementation FlashBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (id)initWithChoice:(int)choice diff --git a/src/Catty/DataModel/Bricks/IO/VibrationBrick.m b/src/Catty/DataModel/Bricks/IO/VibrationBrick.m index 1f4cb4f553..e60cdd94ff 100644 --- a/src/Catty/DataModel/Bricks/IO/VibrationBrick.m +++ b/src/Catty/DataModel/Bricks/IO/VibrationBrick.m @@ -25,9 +25,9 @@ @implementation VibrationBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/AskBrick.swift b/src/Catty/DataModel/Bricks/Look/AskBrick.swift index a3e1d47c5c..8e6e7ff05f 100644 --- a/src/Catty/DataModel/Bricks/Look/AskBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/AskBrick.swift @@ -31,8 +31,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue), NSNumber(value: kBrickCategoryType.dataBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/CameraBrick.m b/src/Catty/DataModel/Bricks/Look/CameraBrick.m index 13fd40421f..d7226f7b43 100644 --- a/src/Catty/DataModel/Bricks/Look/CameraBrick.m +++ b/src/Catty/DataModel/Bricks/Look/CameraBrick.m @@ -24,9 +24,9 @@ @implementation CameraBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (id)initWithChoice:(int)choice diff --git a/src/Catty/DataModel/Bricks/Look/ChangeBrightnessByNBrick.swift b/src/Catty/DataModel/Bricks/Look/ChangeBrightnessByNBrick.swift index 7437009df5..1ebc523a98 100644 --- a/src/Catty/DataModel/Bricks/Look/ChangeBrightnessByNBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/ChangeBrightnessByNBrick.swift @@ -28,8 +28,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } func formula(forLineNumber lineNumber: Int, andParameterNumber paramNumber: Int) -> Formula? { diff --git a/src/Catty/DataModel/Bricks/Look/ChangeColorByNBrick.m b/src/Catty/DataModel/Bricks/Look/ChangeColorByNBrick.m index 9e7bfe9f83..07cd4afa51 100644 --- a/src/Catty/DataModel/Bricks/Look/ChangeColorByNBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ChangeColorByNBrick.m @@ -26,9 +26,9 @@ @implementation ChangeColorByNBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/ChangeTransparencyByNBrick.m b/src/Catty/DataModel/Bricks/Look/ChangeTransparencyByNBrick.m index c881a7e1d0..d1b8636d48 100644 --- a/src/Catty/DataModel/Bricks/Look/ChangeTransparencyByNBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ChangeTransparencyByNBrick.m @@ -28,9 +28,9 @@ @implementation ChangeTransparencyByNBrick @synthesize changeTransparency = _changeTransparency; -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/ChooseCameraBrick.m b/src/Catty/DataModel/Bricks/Look/ChooseCameraBrick.m index f15d8ba8dd..4544df1e7f 100644 --- a/src/Catty/DataModel/Bricks/Look/ChooseCameraBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ChooseCameraBrick.m @@ -24,9 +24,9 @@ @implementation ChooseCameraBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (id)initWithChoice:(int)choice diff --git a/src/Catty/DataModel/Bricks/Look/ClearGraphicEffectBrick.m b/src/Catty/DataModel/Bricks/Look/ClearGraphicEffectBrick.m index 83b7cbdb5d..2d51af49f0 100644 --- a/src/Catty/DataModel/Bricks/Look/ClearGraphicEffectBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ClearGraphicEffectBrick.m @@ -26,9 +26,9 @@ @implementation ClearGraphicEffectBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (NSString*)pathForLook:(Look*)look diff --git a/src/Catty/DataModel/Bricks/Look/HideBrick.m b/src/Catty/DataModel/Bricks/Look/HideBrick.m index 6ce49c261b..6d0e4146e9 100644 --- a/src/Catty/DataModel/Bricks/Look/HideBrick.m +++ b/src/Catty/DataModel/Bricks/Look/HideBrick.m @@ -24,9 +24,9 @@ @implementation HideBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Look/NextLookBrick.swift b/src/Catty/DataModel/Bricks/Look/NextLookBrick.swift index b46eb2d06f..edf24793bb 100644 --- a/src/Catty/DataModel/Bricks/Look/NextLookBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/NextLookBrick.swift @@ -30,8 +30,8 @@ look.path(for: script.object.scene) } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/PreviousLookBrick.swift b/src/Catty/DataModel/Bricks/Look/PreviousLookBrick.swift index a9509f5ef0..449e942ceb 100644 --- a/src/Catty/DataModel/Bricks/Look/PreviousLookBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/PreviousLookBrick.swift @@ -22,6 +22,7 @@ @objc(PreviousLookBrick) @objcMembers class PreviousLookBrick: Brick, BrickProtocol { + override public required init() { super.init() } @@ -30,8 +31,8 @@ look.path(for: script.object.scene) } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/SayBubbleBrick.m b/src/Catty/DataModel/Bricks/Look/SayBubbleBrick.m index 29092facb1..911f1d48be 100644 --- a/src/Catty/DataModel/Bricks/Look/SayBubbleBrick.m +++ b/src/Catty/DataModel/Bricks/Look/SayBubbleBrick.m @@ -24,9 +24,9 @@ @implementation SayBubbleBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Look/SayForBubbleBrick.m b/src/Catty/DataModel/Bricks/Look/SayForBubbleBrick.m index ba060837a8..fe929a3d72 100644 --- a/src/Catty/DataModel/Bricks/Look/SayForBubbleBrick.m +++ b/src/Catty/DataModel/Bricks/Look/SayForBubbleBrick.m @@ -33,9 +33,9 @@ - (id)init return self; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Look/SetBackgroundAndWaitBrick.swift b/src/Catty/DataModel/Bricks/Look/SetBackgroundAndWaitBrick.swift index c37ad67469..1ad8b386ae 100644 --- a/src/Catty/DataModel/Bricks/Look/SetBackgroundAndWaitBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetBackgroundAndWaitBrick.swift @@ -45,8 +45,8 @@ return path } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/SetBackgroundBrick.swift b/src/Catty/DataModel/Bricks/Look/SetBackgroundBrick.swift index ab1235b08e..45ceaa9e5e 100644 --- a/src/Catty/DataModel/Bricks/Look/SetBackgroundBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetBackgroundBrick.swift @@ -22,6 +22,7 @@ @objc(SetBackgroundBrick) @objcMembers class SetBackgroundBrick: Brick, BrickLookProtocol { + @objc var look: Look? init(look: Look) { @@ -33,8 +34,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } func pathForLook() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/SetBackgroundByIndexBrick.swift b/src/Catty/DataModel/Bricks/Look/SetBackgroundByIndexBrick.swift index 0f7f4770a9..5ad357668b 100644 --- a/src/Catty/DataModel/Bricks/Look/SetBackgroundByIndexBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetBackgroundByIndexBrick.swift @@ -31,8 +31,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/SetBrightnessBrick.swift b/src/Catty/DataModel/Bricks/Look/SetBrightnessBrick.swift index 0fbb9d69c7..fd1674a07d 100644 --- a/src/Catty/DataModel/Bricks/Look/SetBrightnessBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetBrightnessBrick.swift @@ -28,8 +28,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } func formula(forLineNumber lineNumber: Int, andParameterNumber paramNumber: Int) -> Formula? { diff --git a/src/Catty/DataModel/Bricks/Look/SetColorBrick.m b/src/Catty/DataModel/Bricks/Look/SetColorBrick.m index 5111d508a1..28ecd5e653 100644 --- a/src/Catty/DataModel/Bricks/Look/SetColorBrick.m +++ b/src/Catty/DataModel/Bricks/Look/SetColorBrick.m @@ -28,9 +28,9 @@ @implementation SetColorBrick @synthesize color = _color; -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/SetLookBrick.swift b/src/Catty/DataModel/Bricks/Look/SetLookBrick.swift index 83f3362670..a99bfb66bf 100644 --- a/src/Catty/DataModel/Bricks/Look/SetLookBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetLookBrick.swift @@ -33,8 +33,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override func isDisabledForBackground() -> Bool { diff --git a/src/Catty/DataModel/Bricks/Look/SetLookByIndexBrick.swift b/src/Catty/DataModel/Bricks/Look/SetLookByIndexBrick.swift index 578cdab7c5..ebaf0213f5 100644 --- a/src/Catty/DataModel/Bricks/Look/SetLookByIndexBrick.swift +++ b/src/Catty/DataModel/Bricks/Look/SetLookByIndexBrick.swift @@ -31,8 +31,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.lookBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Look/SetSizeToBrick.m b/src/Catty/DataModel/Bricks/Look/SetSizeToBrick.m index 85545040df..2015f377b5 100644 --- a/src/Catty/DataModel/Bricks/Look/SetSizeToBrick.m +++ b/src/Catty/DataModel/Bricks/Look/SetSizeToBrick.m @@ -25,9 +25,9 @@ @implementation SetSizeToBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/SetTransparencyBrick.m b/src/Catty/DataModel/Bricks/Look/SetTransparencyBrick.m index 966aaae167..4a968405ed 100644 --- a/src/Catty/DataModel/Bricks/Look/SetTransparencyBrick.m +++ b/src/Catty/DataModel/Bricks/Look/SetTransparencyBrick.m @@ -28,9 +28,9 @@ @implementation SetTransparencyBrick @synthesize transparency = _transparency; -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Look/ShowBrick.m b/src/Catty/DataModel/Bricks/Look/ShowBrick.m index c24337e4cb..7ba48e0266 100644 --- a/src/Catty/DataModel/Bricks/Look/ShowBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ShowBrick.m @@ -25,9 +25,9 @@ @implementation ShowBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Look/ThinkBubbleBrick.m b/src/Catty/DataModel/Bricks/Look/ThinkBubbleBrick.m index f7fc504d0e..9ed69b3b57 100644 --- a/src/Catty/DataModel/Bricks/Look/ThinkBubbleBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ThinkBubbleBrick.m @@ -24,9 +24,9 @@ @implementation ThinkBubbleBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Look/ThinkForBubbleBrick.m b/src/Catty/DataModel/Bricks/Look/ThinkForBubbleBrick.m index d967e0209e..e18d5fcc1e 100644 --- a/src/Catty/DataModel/Bricks/Look/ThinkForBubbleBrick.m +++ b/src/Catty/DataModel/Bricks/Look/ThinkForBubbleBrick.m @@ -25,9 +25,9 @@ @implementation ThinkForBubbleBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Motion/ChangeSizeByNBrick.m b/src/Catty/DataModel/Bricks/Motion/ChangeSizeByNBrick.m index a8836100db..2083ce2d82 100644 --- a/src/Catty/DataModel/Bricks/Motion/ChangeSizeByNBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/ChangeSizeByNBrick.m @@ -26,9 +26,9 @@ @implementation ChangeSizeByNBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kLookBrick; + return @[@(kLookBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Motion/ChangeXByNBrick.m b/src/Catty/DataModel/Bricks/Motion/ChangeXByNBrick.m index 81109ebe6f..862d87d1b8 100644 --- a/src/Catty/DataModel/Bricks/Motion/ChangeXByNBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/ChangeXByNBrick.m @@ -51,9 +51,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject self.xMovement = [[Formula alloc] initWithInteger:10]; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Motion/ChangeYByNBrick.m b/src/Catty/DataModel/Bricks/Motion/ChangeYByNBrick.m index 82a1eb56a7..932dbab0e9 100644 --- a/src/Catty/DataModel/Bricks/Motion/ChangeYByNBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/ChangeYByNBrick.m @@ -26,9 +26,9 @@ @implementation ChangeYByNBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Motion/ComeToFrontBrick.m b/src/Catty/DataModel/Bricks/Motion/ComeToFrontBrick.m index f14fa427e3..eb4484ca5e 100644 --- a/src/Catty/DataModel/Bricks/Motion/ComeToFrontBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/ComeToFrontBrick.m @@ -26,9 +26,9 @@ @implementation ComeToFrontBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (BOOL)isDisabledForBackground diff --git a/src/Catty/DataModel/Bricks/Motion/GlideToBrick.m b/src/Catty/DataModel/Bricks/Motion/GlideToBrick.m index c1dc0816dd..7350463768 100644 --- a/src/Catty/DataModel/Bricks/Motion/GlideToBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/GlideToBrick.m @@ -34,9 +34,9 @@ @implementation GlideToBrick @synthesize xDestination = _xDestination; @synthesize yDestination = _yDestination; -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Motion/GoNStepsBackBrick.m b/src/Catty/DataModel/Bricks/Motion/GoNStepsBackBrick.m index f120f48877..7ef530d4a2 100644 --- a/src/Catty/DataModel/Bricks/Motion/GoNStepsBackBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/GoNStepsBackBrick.m @@ -56,9 +56,9 @@ - (BOOL)isDisabledForBackground return YES; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Motion/GoToBrick.m b/src/Catty/DataModel/Bricks/Motion/GoToBrick.m index 1edbefcde1..c8fb1dbcdb 100644 --- a/src/Catty/DataModel/Bricks/Motion/GoToBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/GoToBrick.m @@ -29,9 +29,9 @@ @interface GoToBrick() @implementation GoToBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (id)initWithChoice:(int)choice diff --git a/src/Catty/DataModel/Bricks/Motion/IfOnEdgeBounceBrick.m b/src/Catty/DataModel/Bricks/Motion/IfOnEdgeBounceBrick.m index 94e3ac771a..3e77619b5d 100644 --- a/src/Catty/DataModel/Bricks/Motion/IfOnEdgeBounceBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/IfOnEdgeBounceBrick.m @@ -31,9 +31,9 @@ - (BOOL)isSelectableForObject return (! [self.script.object isBackground]); } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (void)performFromScript:(Script*)script; diff --git a/src/Catty/DataModel/Bricks/Motion/MoveNStepsBrick.m b/src/Catty/DataModel/Bricks/Motion/MoveNStepsBrick.m index 9757ea4d69..1052f30ea4 100644 --- a/src/Catty/DataModel/Bricks/Motion/MoveNStepsBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/MoveNStepsBrick.m @@ -50,9 +50,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject self.steps = [[Formula alloc] initWithInteger:10]; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (void)performFromScript:(Script *)script diff --git a/src/Catty/DataModel/Bricks/Motion/PlaceAtBrick.m b/src/Catty/DataModel/Bricks/Motion/PlaceAtBrick.m index 1a70d1e360..c60a5849d3 100644 --- a/src/Catty/DataModel/Bricks/Motion/PlaceAtBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/PlaceAtBrick.m @@ -59,9 +59,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject self.yPosition = [[Formula alloc] initWithInteger:200]; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Motion/PointInDirectionBrick.m b/src/Catty/DataModel/Bricks/Motion/PointInDirectionBrick.m index 71a3297618..7f98195e6d 100644 --- a/src/Catty/DataModel/Bricks/Motion/PointInDirectionBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/PointInDirectionBrick.m @@ -25,9 +25,9 @@ @implementation PointInDirectionBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Motion/PointToBrick.m b/src/Catty/DataModel/Bricks/Motion/PointToBrick.m index a609fa7140..66e484dbdb 100644 --- a/src/Catty/DataModel/Bricks/Motion/PointToBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/PointToBrick.m @@ -99,9 +99,9 @@ - (NSInteger)getRequiredResources return kNoResources; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } @end diff --git a/src/Catty/DataModel/Bricks/Motion/SetRotationStyleBrick.swift b/src/Catty/DataModel/Bricks/Motion/SetRotationStyleBrick.swift index 1c9519cb8c..cbe81044f5 100644 --- a/src/Catty/DataModel/Bricks/Motion/SetRotationStyleBrick.swift +++ b/src/Catty/DataModel/Bricks/Motion/SetRotationStyleBrick.swift @@ -36,8 +36,8 @@ self.selection = type(of: self).defaultSelection } - func category() -> kBrickCategoryType { - kBrickCategoryType.motionBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.motionBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Motion/SetXBrick.m b/src/Catty/DataModel/Bricks/Motion/SetXBrick.m index 22604ca96a..6efff1ad0a 100644 --- a/src/Catty/DataModel/Bricks/Motion/SetXBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/SetXBrick.m @@ -51,9 +51,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject self.xPosition = [[Formula alloc] initWithInteger:100]; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Motion/SetYBrick.m b/src/Catty/DataModel/Bricks/Motion/SetYBrick.m index 59c7ac92a6..c1d423a4ff 100644 --- a/src/Catty/DataModel/Bricks/Motion/SetYBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/SetYBrick.m @@ -50,9 +50,9 @@ - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject self.yPosition = [[Formula alloc] initWithInteger:200]; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Motion/TurnLeftBrick.m b/src/Catty/DataModel/Bricks/Motion/TurnLeftBrick.m index 28df3370e2..023105b823 100644 --- a/src/Catty/DataModel/Bricks/Motion/TurnLeftBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/TurnLeftBrick.m @@ -25,9 +25,9 @@ @implementation TurnLeftBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Motion/TurnRightBrick.m b/src/Catty/DataModel/Bricks/Motion/TurnRightBrick.m index a4596a10ee..3a8e3440c1 100644 --- a/src/Catty/DataModel/Bricks/Motion/TurnRightBrick.m +++ b/src/Catty/DataModel/Bricks/Motion/TurnRightBrick.m @@ -25,9 +25,9 @@ @implementation TurnRightBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kMotionBrick; + return @[@(kMotionBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Pen/PenClearBrick.swift b/src/Catty/DataModel/Bricks/Pen/PenClearBrick.swift index afde427fcd..f7912232e5 100644 --- a/src/Catty/DataModel/Bricks/Pen/PenClearBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/PenClearBrick.swift @@ -27,8 +27,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Pen/PenDownBrick.swift b/src/Catty/DataModel/Bricks/Pen/PenDownBrick.swift index fdf9a35792..79878ffea3 100644 --- a/src/Catty/DataModel/Bricks/Pen/PenDownBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/PenDownBrick.swift @@ -27,8 +27,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Pen/PenUpBrick.swift b/src/Catty/DataModel/Bricks/Pen/PenUpBrick.swift index bd0600cbf2..1b8c03cf7b 100644 --- a/src/Catty/DataModel/Bricks/Pen/PenUpBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/PenUpBrick.swift @@ -28,8 +28,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Pen/SetPenColorBrick.swift b/src/Catty/DataModel/Bricks/Pen/SetPenColorBrick.swift index 9b61f0ce5e..e1d304387c 100644 --- a/src/Catty/DataModel/Bricks/Pen/SetPenColorBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/SetPenColorBrick.swift @@ -31,8 +31,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Pen/SetPenSizeBrick.swift b/src/Catty/DataModel/Bricks/Pen/SetPenSizeBrick.swift index 9c61879fde..5e90c1d9d0 100644 --- a/src/Catty/DataModel/Bricks/Pen/SetPenSizeBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/SetPenSizeBrick.swift @@ -29,8 +29,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Pen/StampBrick.swift b/src/Catty/DataModel/Bricks/Pen/StampBrick.swift index e34b301f73..086c5ce454 100644 --- a/src/Catty/DataModel/Bricks/Pen/StampBrick.swift +++ b/src/Catty/DataModel/Bricks/Pen/StampBrick.swift @@ -27,8 +27,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.penBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.penBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveBackwardBrick.m b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveBackwardBrick.m index 380f81e08b..8ef621f903 100644 --- a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveBackwardBrick.m +++ b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveBackwardBrick.m @@ -26,9 +26,9 @@ @implementation PhiroMotorMoveBackwardBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kPhiroBrick; + return @[@(kPhiroBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveForwardBrick.m b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveForwardBrick.m index aa343546d3..c9d7c5498d 100644 --- a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveForwardBrick.m +++ b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorMoveForwardBrick.m @@ -26,9 +26,9 @@ @implementation PhiroMotorMoveForwardBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kPhiroBrick; + return @[@(kPhiroBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorStopBrick.m b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorStopBrick.m index 09c455fb1f..1d9150ce6b 100644 --- a/src/Catty/DataModel/Bricks/Phiro/PhiroMotorStopBrick.m +++ b/src/Catty/DataModel/Bricks/Phiro/PhiroMotorStopBrick.m @@ -25,9 +25,9 @@ @implementation PhiroMotorStopBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kPhiroBrick; + return @[@(kPhiroBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Phiro/PhiroPlayToneBrick.m b/src/Catty/DataModel/Bricks/Phiro/PhiroPlayToneBrick.m index b23fa0e11b..37124ea6a3 100644 --- a/src/Catty/DataModel/Bricks/Phiro/PhiroPlayToneBrick.m +++ b/src/Catty/DataModel/Bricks/Phiro/PhiroPlayToneBrick.m @@ -26,9 +26,9 @@ @implementation PhiroPlayToneBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kPhiroBrick; + return @[@(kPhiroBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Phiro/PhiroRGBLightBrick.m b/src/Catty/DataModel/Bricks/Phiro/PhiroRGBLightBrick.m index e4eb1ac498..13989e094a 100644 --- a/src/Catty/DataModel/Bricks/Phiro/PhiroRGBLightBrick.m +++ b/src/Catty/DataModel/Bricks/Phiro/PhiroRGBLightBrick.m @@ -25,9 +25,9 @@ @implementation PhiroRGBLightBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kPhiroBrick; + return @[@(kPhiroBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Bricks/Sound/ChangeVolumeByNBrick.m b/src/Catty/DataModel/Bricks/Sound/ChangeVolumeByNBrick.m index a8b44374be..8f6479e03d 100644 --- a/src/Catty/DataModel/Bricks/Sound/ChangeVolumeByNBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/ChangeVolumeByNBrick.m @@ -27,9 +27,9 @@ @implementation ChangeVolumeByNBrick @synthesize volume = _volume; -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Sound/PlaySoundAndWaitBrick.m b/src/Catty/DataModel/Bricks/Sound/PlaySoundAndWaitBrick.m index 97441f2f3c..8ec3eec808 100644 --- a/src/Catty/DataModel/Bricks/Sound/PlaySoundAndWaitBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/PlaySoundAndWaitBrick.m @@ -26,9 +26,9 @@ @implementation PlaySoundAndWaitBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } #pragma mark - Copy diff --git a/src/Catty/DataModel/Bricks/Sound/PlaySoundBrick.m b/src/Catty/DataModel/Bricks/Sound/PlaySoundBrick.m index d41ae2c099..67a8de5903 100644 --- a/src/Catty/DataModel/Bricks/Sound/PlaySoundBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/PlaySoundBrick.m @@ -26,9 +26,9 @@ @implementation PlaySoundBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } #pragma mark - Copy diff --git a/src/Catty/DataModel/Bricks/Sound/SetInstrumentBrick.swift b/src/Catty/DataModel/Bricks/Sound/SetInstrumentBrick.swift index 72f81a0fc4..f93c86aced 100644 --- a/src/Catty/DataModel/Bricks/Sound/SetInstrumentBrick.swift +++ b/src/Catty/DataModel/Bricks/Sound/SetInstrumentBrick.swift @@ -31,7 +31,9 @@ import Foundation super.init() } - func category() -> kBrickCategoryType { kBrickCategoryType.soundBrick } + func category() -> [NSNumber] { + [NSNumber(value: kBrickCategoryType.soundBrick.rawValue)] + } override func getRequiredResources() -> Int { ResourceType.noResources.rawValue } diff --git a/src/Catty/DataModel/Bricks/Sound/SetTempoToBrick.swift b/src/Catty/DataModel/Bricks/Sound/SetTempoToBrick.swift index 41d2f68366..539d6e5f89 100644 --- a/src/Catty/DataModel/Bricks/Sound/SetTempoToBrick.swift +++ b/src/Catty/DataModel/Bricks/Sound/SetTempoToBrick.swift @@ -30,8 +30,8 @@ super.init() } - func category() -> kBrickCategoryType { - kBrickCategoryType.soundBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.soundBrick.rawValue)] } override class func description() -> String { diff --git a/src/Catty/DataModel/Bricks/Sound/SetVolumeToBrick.m b/src/Catty/DataModel/Bricks/Sound/SetVolumeToBrick.m index 95d9c45242..2b664832d3 100644 --- a/src/Catty/DataModel/Bricks/Sound/SetVolumeToBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/SetVolumeToBrick.m @@ -25,9 +25,9 @@ @implementation SetVolumeToBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } - (Formula*)formulaForLineNumber:(NSInteger)lineNumber andParameterNumber:(NSInteger)paramNumber diff --git a/src/Catty/DataModel/Bricks/Sound/SpeakAndWaitBrick.m b/src/Catty/DataModel/Bricks/Sound/SpeakAndWaitBrick.m index da4630e3ad..b207531f5e 100644 --- a/src/Catty/DataModel/Bricks/Sound/SpeakAndWaitBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/SpeakAndWaitBrick.m @@ -24,9 +24,9 @@ @implementation SpeakAndWaitBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Sound/SpeakBrick.m b/src/Catty/DataModel/Bricks/Sound/SpeakBrick.m index c1095968b1..4feab65ece 100644 --- a/src/Catty/DataModel/Bricks/Sound/SpeakBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/SpeakBrick.m @@ -24,9 +24,9 @@ @implementation SpeakBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } - (BOOL)allowsStringFormula diff --git a/src/Catty/DataModel/Bricks/Sound/StopAllSoundsBrick.m b/src/Catty/DataModel/Bricks/Sound/StopAllSoundsBrick.m index 4c017b1957..6d03639a64 100644 --- a/src/Catty/DataModel/Bricks/Sound/StopAllSoundsBrick.m +++ b/src/Catty/DataModel/Bricks/Sound/StopAllSoundsBrick.m @@ -24,9 +24,9 @@ @implementation StopAllSoundsBrick -- (kBrickCategoryType)category +- (NSArray *)category { - return kSoundBrick; + return @[@(kSoundBrick)]; } #pragma mark - Description diff --git a/src/Catty/DataModel/Scripts/BroadcastScript.m b/src/Catty/DataModel/Scripts/BroadcastScript.m index 54565faf73..1e0611c91e 100644 --- a/src/Catty/DataModel/Scripts/BroadcastScript.m +++ b/src/Catty/DataModel/Scripts/BroadcastScript.m @@ -27,9 +27,9 @@ @implementation BroadcastScript -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kEventBrick),@(kControlBrick)]; } - (void)setDefaultValuesForObject:(SpriteObject*)spriteObject diff --git a/src/Catty/DataModel/Scripts/StartScript.m b/src/Catty/DataModel/Scripts/StartScript.m index cfff1fa4c0..08dca1b4d6 100644 --- a/src/Catty/DataModel/Scripts/StartScript.m +++ b/src/Catty/DataModel/Scripts/StartScript.m @@ -24,9 +24,9 @@ @implementation StartScript -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kEventBrick)]; } @end diff --git a/src/Catty/DataModel/Scripts/WhenBackgroundChangesScript.swift b/src/Catty/DataModel/Scripts/WhenBackgroundChangesScript.swift index 8ebdb68440..873669bb16 100644 --- a/src/Catty/DataModel/Scripts/WhenBackgroundChangesScript.swift +++ b/src/Catty/DataModel/Scripts/WhenBackgroundChangesScript.swift @@ -39,8 +39,8 @@ class WhenBackgroundChangesScript: Script, BrickLookProtocol { super.init() } - public func category() -> kBrickCategoryType { - kBrickCategoryType.eventBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.eventBrick.rawValue), NSNumber(value: kBrickCategoryType.lookBrick.rawValue)] } override func description() -> String { diff --git a/src/Catty/DataModel/Scripts/WhenConditionScript.swift b/src/Catty/DataModel/Scripts/WhenConditionScript.swift index 310640f4a8..949f4d7572 100644 --- a/src/Catty/DataModel/Scripts/WhenConditionScript.swift +++ b/src/Catty/DataModel/Scripts/WhenConditionScript.swift @@ -24,6 +24,7 @@ import Foundation @objc(WhenConditionScript) class WhenConditionScript: Script, BrickFormulaProtocol { + @objc var condition: Formula @objc var preCondition: Bool @@ -43,8 +44,8 @@ class WhenConditionScript: Script, BrickFormulaProtocol { super.init() } - public func category() -> kBrickCategoryType { - kBrickCategoryType.eventBrick + func category() -> [NSNumber]! { + [NSNumber(value: kBrickCategoryType.eventBrick.rawValue)] } override func isAnimateable() -> Bool { diff --git a/src/Catty/DataModel/Scripts/WhenScript.m b/src/Catty/DataModel/Scripts/WhenScript.m index 781b1bf1b7..d97e285e22 100644 --- a/src/Catty/DataModel/Scripts/WhenScript.m +++ b/src/Catty/DataModel/Scripts/WhenScript.m @@ -34,9 +34,9 @@ - (instancetype)init { return self; } -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kEventBrick)]; } - (BOOL)isEqualToScript:(Script *)script diff --git a/src/Catty/DataModel/Scripts/WhenTouchDownScript.m b/src/Catty/DataModel/Scripts/WhenTouchDownScript.m index b84b5e2d94..6d37f0d3db 100644 --- a/src/Catty/DataModel/Scripts/WhenTouchDownScript.m +++ b/src/Catty/DataModel/Scripts/WhenTouchDownScript.m @@ -24,9 +24,9 @@ @implementation WhenTouchDownScript -- (kBrickCategoryType)category +- (NSArray *)category { - return kEventBrick; + return @[@(kEventBrick)]; } @end diff --git a/src/Catty/Extension&Delegate&Protocol/Protocols/Bricks/BrickProtocol.h b/src/Catty/Extension&Delegate&Protocol/Protocols/Bricks/BrickProtocol.h index 41978a89a3..75ebe463f2 100644 --- a/src/Catty/Extension&Delegate&Protocol/Protocols/Bricks/BrickProtocol.h +++ b/src/Catty/Extension&Delegate&Protocol/Protocols/Bricks/BrickProtocol.h @@ -32,7 +32,7 @@ @property (nonatomic, getter=isAnimatedMoveBrick) BOOL animateMoveBrick; @property (nonatomic) BOOL isDisabled; -- (kBrickCategoryType)category; +- (NSArray *)category; - (NSInteger)getRequiredResources; - (BOOL)isDisabledForBackground; diff --git a/src/Catty/ViewController/Continue&New/MaintainObject/MaintainScript/BrickManager/BrickManager.m b/src/Catty/ViewController/Continue&New/MaintainObject/MaintainScript/BrickManager/BrickManager.m index 29d0dbca41..22b9f1fca0 100644 --- a/src/Catty/ViewController/Continue&New/MaintainObject/MaintainScript/BrickManager/BrickManager.m +++ b/src/Catty/ViewController/Continue&New/MaintainObject/MaintainScript/BrickManager/BrickManager.m @@ -93,10 +93,11 @@ - (NSArray*)selectableBricksForCategoryType:(kBrickCategoryType)categoryType inB } return (NSArray*)selectableBricksForCategoryMutable; } + for (id brick in selectableBricks) { if (inBackground && brick.isDisabledForBackground) { continue; - } else if (brick.category == categoryType) { + } else if ([brick.category containsObject:@(categoryType)]) { [selectableBricksForCategoryMutable addObject:brick]; } } diff --git a/src/Catty/Views/Custom/CollectionViewCells/BrickCellData/BrickCellFormulaData.m b/src/Catty/Views/Custom/CollectionViewCells/BrickCellData/BrickCellFormulaData.m index 1ab0e70210..bb22c31b81 100644 --- a/src/Catty/Views/Custom/CollectionViewCells/BrickCellData/BrickCellFormulaData.m +++ b/src/Catty/Views/Custom/CollectionViewCells/BrickCellData/BrickCellFormulaData.m @@ -28,6 +28,7 @@ #import "GlideToBrickCell.h" #import "BrickManager.h" #import "Pocket_Code-Swift.h" +#import "LanguageTranslationDefines.h" @interface BrickCellFormulaData() @property (nonatomic, strong) CAShapeLayer *border; @@ -123,7 +124,7 @@ - (void)drawBorder:(BOOL)isActive self.border.shadowOpacity = 1.0; self.border.shadowOffset = CGSizeMake(0, 0); } else { - BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType:self.brickCell.scriptOrBrick.category]; + BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType: (kBrickCategoryType) (NSUInteger) [self.brickCell.scriptOrBrick.category[0] integerValue] ]; self.border.strokeColor = self.brickCell.scriptOrBrick.isDisabled ? [category strokeColorDisabled].CGColor : category.strokeColor.CGColor; } diff --git a/src/Catty/Views/Custom/CollectionViewCells/BrickCells/BrickCell.m b/src/Catty/Views/Custom/CollectionViewCells/BrickCells/BrickCell.m index f309ddcea0..0ab793ed3b 100644 --- a/src/Catty/Views/Custom/CollectionViewCells/BrickCells/BrickCell.m +++ b/src/Catty/Views/Custom/CollectionViewCells/BrickCells/BrickCell.m @@ -424,7 +424,7 @@ - (void)drawRect:(CGRect)rect { CGFloat height = [[self class] cellHeight]; CGFloat width = [Util screenWidth]; - BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType:self.scriptOrBrick.category]; + BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType:(kBrickCategoryType) (NSUInteger) [self.scriptOrBrick.category[0] integerValue]]; UIColor *fillColor = category.color; UIColor *strokeColor = category.strokeColor; diff --git a/src/Catty/Views/Custom/CollectionViewCells/BrickCells/Control/LoopEndBrickCell.m b/src/Catty/Views/Custom/CollectionViewCells/BrickCells/Control/LoopEndBrickCell.m index 6512659068..4a291ef69d 100644 --- a/src/Catty/Views/Custom/CollectionViewCells/BrickCells/Control/LoopEndBrickCell.m +++ b/src/Catty/Views/Custom/CollectionViewCells/BrickCells/Control/LoopEndBrickCell.m @@ -39,7 +39,7 @@ + (CGFloat)cellHeight - (void)drawRect:(CGRect)rect { LoopEndBrick *brick = (LoopEndBrick*)[self scriptOrBrick]; - BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType:brick.category]; + BrickCategory *category = [[[BrickManager class] sharedBrickManager] categoryForType:(kBrickCategoryType) (NSUInteger) [brick.category[0] integerValue]]; CGFloat height = [[self class] cellHeight] + marginBottomSquaredBrick; CGFloat width = [Util screenWidth];