public static FightAnimation ReadFromFile(ResourceDataFile reader) { FightAnimation definition = new FightAnimation(); definition.AnimationId = reader.ReadInt(); if (definition.AnimationId < 0) { return(null); } reader.ReadInt(); definition.IdleFrameCount = reader.ReadInt(); definition.AttackFrameCount = reader.ReadInt(); definition.AttackPercentageByFrame = new Dictionary <int, int>(); for (int i = 0; i < definition.AttackFrameCount; i++) { int val = reader.ReadInt(); if (val > 0) { definition.AttackPercentageByFrame[i] = val; } } definition.RemoteAttackFrame = reader.ReadInt(); return(definition); }
private void LoadFightAnimations() { fightAnimations = new Dictionary <int, FightAnimation>(); ResourceDataFile fileReader = new ResourceDataFile(@"Data/FightAnimation"); FightAnimation def = null; while ((def = FightAnimation.ReadFromFile(fileReader)) != null) { fightAnimations[def.AnimationId] = def; } }