Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- using System.Windows.Media;
- using Reversi.Domain;
- using Reversi.Cells;
- namespace ReversiGUI
- {
- //[ValueConversion(typeof(object), typeof(string))]
- public class PlayerToColorTilesConvertor : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- ICell<String> temp = (ICell<String>)value;
- String format = temp.Value;
- if (format != null)
- {
- if (format.Equals("ValidMove"))
- return Colors.SkyBlue;
- else if (format.Equals("PlayerOne"))
- return Colors.Black;
- else if (format.Equals("PlayerTwo"))
- return Colors.White;
- else if (format.Equals("NoTile"))
- return Colors.Transparent;
- else
- return Colors.Transparent;
- }
- else
- return Colors.Transparent;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement