private static List <CompositeFrame> CreateFrames( List <SpriteSheet> Layers, List <Color> Tints, List <List <int> > Frames) { var frameList = new List <CompositeFrame>(); foreach (var frame in Frames) { var currentFrame = new CompositeFrame(); //[0, 1, 2, 3] //Values 0 and 1 are the tile to draw. //2 and beyond are the layers to draw. for (int j = 2; j < frame.Count; j++) { var cell = new CompositeCell { Tile = new Point(frame[0], frame[1]), Sheet = Layers[frame[j]], Tint = Tints[Math.Min(Math.Max(frame[j], 0), Tints.Count - 1)] }; currentFrame.Cells.Add(cell); } frameList.Add(currentFrame); } return(frameList); }
protected bool Equals(CompositeCell otherFrame) { if (Sheet != otherFrame.Sheet) { return(false); } if (Tint != otherFrame.Tint) { return(false); } if (Tile != otherFrame.Tile) { return(false); } return(true); }