public static SolidColorBrush getBrush(CubieColor color) { switch (color) { case CubieColor.B: return(Brushes.Blue); case CubieColor.G: return(Brushes.Green); case CubieColor.O: return(Brushes.Orange); case CubieColor.R: return(Brushes.Red); case CubieColor.W: return(Brushes.White); case CubieColor.Y: return(Brushes.Yellow); default: return(null); } }
/// <summary> /// Returns a cubie by colors /// </summary> /// <param name="col1">color 1</param> /// <param name="col2">color 2</param> /// <param name="col3">color 3</param> /// <returns></returns> public Cubie getCubie(CubieColor col1, CubieColor col2, CubieColor col3) { Cubie cube = this.cubies.Where(q => ((q.ColX == col1 && q.ColY == col2 && q.ColZ == col3) || (q.ColX == col1 && q.ColY == col3 && q.ColZ == col2) || (q.ColX == col2 && q.ColY == col1 && q.ColZ == col3) || (q.ColX == col2 && q.ColY == col3 && q.ColZ == col1) || (q.ColX == col3 && q.ColY == col1 && q.ColZ == col2) || (q.ColX == col3 && q.ColY == col2 && q.ColZ == col1))).Select(q => q).FirstOrDefault(); return(cube); }
public Cubie(CubieType type, int posX, int posY, int posZ, CubieColor colX, CubieColor colY, CubieColor colZ) { this.type = type; this.posX = posX; this.posY = posY; this.posZ = posZ; this.colX = colX; this.colY = colY; this.colZ = colZ; }
public static SolidColorBrush getBrush(CubieColor color) { switch (color) { case CubieColor.B: return Brushes.Blue; case CubieColor.G: return Brushes.Green; case CubieColor.O: return Brushes.Orange; case CubieColor.R: return Brushes.Red; case CubieColor.W: return Brushes.White; case CubieColor.Y: return Brushes.Yellow; default: return null; } }
public Cubie(CubieColor colX, CubieColor colY, CubieColor colZ) { this.colX = colX; this.colY = colY; this.colZ = colZ; }
/// <summary> /// Returns a cubie by colors /// </summary> /// <param name="col1">color 1</param> /// <param name="col2">color 2</param> /// <param name="col3">color 3</param> /// <returns></returns> public Cubie getCubie(CubieColor col1, CubieColor col2, CubieColor col3) { Cubie cube = this.cubies.Where(q => ((q.ColX == col1 && q.ColY == col2 && q.ColZ == col3) || (q.ColX == col1 && q.ColY == col3 && q.ColZ == col2) || (q.ColX == col2 && q.ColY == col1 && q.ColZ == col3) || (q.ColX == col2 && q.ColY == col3 && q.ColZ == col1) || (q.ColX == col3 && q.ColY == col1 && q.ColZ == col2) || (q.ColX == col3 && q.ColY == col2 && q.ColZ == col1))).Select(q => q).FirstOrDefault(); return cube; }
public Cubie(CubiePosition position, CubieColor color) { this.Position = position; this.Color = color; }