public AreaLoader(RomData romData) { RomData = romData ?? throw new ArgumentNullException(nameof(romData)); AreaObjectLoader = new AreaObjectLoader(this); AreaSpriteLoader = new AreaSpriteLoader(this); }
public AreaSpriteRenderer(AreaSpriteLoader areaSpriteLoader) { AreaSpriteLoader = areaSpriteLoader ?? throw new ArgumentNullException(nameof(areaSpriteLoader)); Commands = new Dictionary <AreaSpriteCode, SpriteCallback>() { { AreaSpriteCode.GreenKoopaTroopa, GreenKoopaTroopa }, { AreaSpriteCode.RedKoopaTroopa, RedKoopaTroopa }, { AreaSpriteCode.BuzzyBeetle, BuzzyBeetle }, { AreaSpriteCode.GreenKoopaTroopa2, GreenKoopaTroopa }, { AreaSpriteCode.RedKoopaTroopa2, RedKoopaTroopa }, { AreaSpriteCode.Goomba, Goomba }, { AreaSpriteCode.FireBarClockwise, FireBarClockwise }, { AreaSpriteCode.FireBarCounterClockwise, FireBarCounterClockwise }, { AreaSpriteCode.LiftDown, LiftDown }, { AreaSpriteCode.LiftUp, LiftUp }, { AreaSpriteCode.ShortLiftDown, ShortLiftDown }, { AreaSpriteCode.ShortLiftUp, ShortLiftUp }, { AreaSpriteCode.BalanceRopeLift, BalanceRopeLift }, { AreaSpriteCode.TwoGoombasY10, TwoGoombasY10 }, { AreaSpriteCode.ThreeGoombasY10, ThreeGoombasY10 }, { AreaSpriteCode.TwoGoombasY6, TwoGoombasY6 }, { AreaSpriteCode.ThreeGoombasY6, ThreeGoombasY6 }, { AreaSpriteCode.TwoGreenKoopasY10, TwoGreenKoopasY10 }, { AreaSpriteCode.ThreeGreenKoopasY10, ThreeGreenKoopasY10 }, { AreaSpriteCode.TwoGreenKoopasY6, TwoGreenKoopasY6 }, { AreaSpriteCode.ThreeGreenKoopasY6, ThreeGreenKoopasY6 }, }; ObjectCommands = new Dictionary <AreaObjectCode, SpriteCallback>() { { AreaObjectCode.QuestionBlockPowerup, Powerup }, { AreaObjectCode.BrickPowerup, Powerup }, { AreaObjectCode.Brick1UP, Brick1Up }, { AreaObjectCode.Brick10Coins, Brick10Coins }, { AreaObjectCode.HiddenBlock1UP, Brick1Up }, { AreaObjectCode.EnterablePipe, PiranhaPlant }, { AreaObjectCode.UnenterablePipe, PiranhaPlant }, { AreaObjectCode.SpringBoard, SpringBoard }, { AreaObjectCode.FlagPole, FlagPole }, { AreaObjectCode.AltFlagPole, FlagPole }, { AreaObjectCode.BrickBeanstalk, BeanStalk }, }; }
private void UpdateArea() { var objectAddress = AreaObjectLoader.GetAreaAddress(AreaNumber); CurrentAreaHeader = AreaObjectLoader.GetAreaHeader(objectAddress); CurrentObjectData = new List <AreaObjectCommand>( AreaObjectLoader.GetAreaData(objectAddress + 2)); AreaObjectRenderer.RenderTileMap( AreaType, CurrentAreaHeader, CurrentObjectData); var spriteAddress = AreaSpriteLoader.GetAreaAddress(AreaNumber); CurrentSpriteData = new List <AreaSpriteCommand>( AreaSpriteLoader.GetAreaData(spriteAddress)); }