This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class BetterObject<T> { | |
public static assign<T, U>(target: T, ...sources: U[]): T & U { | |
// Tricking the compiler because merging 2 types by reference isn't truly possible | |
sources.forEach((source) => Object.entries(source).forEach(([key, value]) => target[key as keyof T] = value)); | |
return target as T & U; | |
} | |
public static merge<T>(target: T, ...sources: T[]): T { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <cocos2d.h> | |
using namespace cocos2d; | |
namespace cocos2d { | |
struct CCAnimateFrameCache : CCObject { | |
CCDictionary* m_dict0; | |
CCDictionary* m_dict1; |