public Block Clone(RollTypes roll) { Block block = new Block(); block.Id = this.Id; block.X = this.X; block.Y = this.Y; int x, y; if (roll == RollTypes.Left) { for (y = 0; y < 4; y++) { for (x = 0; x < 4; x++) { block.Data[y, 3 - x] = this.Data[x, y]; } } } else { for (y = 0; y < 4; y++) { for (x = 0; x < 4; x++) { block.Data[3 - y, x] = this.Data[x, y]; } } } return block; }
public static short Roll(RollTypes roleType) { switch (roleType) { case RollTypes.Roll1D6: return(Roll1D6()); case RollTypes.Roll2D6: return(Roll2D6()); case RollTypes.Roll1D6X10Plus1D6: return(Roll1D6X10Plus1D6()); default: throw new Exception("Unknown roll type"); } }
public void Register(RollTypes rollType) { ShiftBonuses(); switch (rollType) { case RollTypes.Strike: _bonuses[2] += 1; _bonuses[1] += 1; break; case RollTypes.Spare: _bonuses[1] += 1; break; case RollTypes.Bonus: _bonuses[0] -= 1; break; } }
public virtual bool HitTest(Block block, RollTypes roll) { var move = block.Clone(roll); return HitTest(move.Data, move.X, move.Y); }
public void Roll(RollTypes roll) { var block = Clone(roll); this.Data = block.Data; }