public PlayerUnitTextureBank MakeCopy() { PlayerUnitTextureBank copyBank = new PlayerUnitTextureBank(); foreach (PlayerUnitAnimationType animationType in _animations.Keys) { SpriteAnimation animationCopy = _animations[animationType].GetFreshCopy(); copyBank.AddAnimation(animationType, animationCopy); } return(copyBank); }
private static void CreateTestSoldier() { var bank = new PlayerUnitTextureBank(); Spritesheet ss = AssetRegistry.TEST_ENTITY; SpriteAnimation idle = new SpriteAnimation() .SetLoop(true) .SetPingPong(true); idle.AddFrame(ss.GetSpriteAt(0, 0), 200); idle.AddFrame(ss.GetSpriteAt(1, 0), 200); idle.AddFrame(ss.GetSpriteAt(2, 0), 200); bank.AddAnimation(PlayerUnitAnimationType.Idle, idle); Register(PlayerUnitType.TestSoldier, bank); }
private static void Register(PlayerUnitType unitType, PlayerUnitTextureBank textureBank) { Textures.Add(unitType, textureBank); }