public MainWindow()
        {
            //Change locale US (make sure language in application)
            CultureInfo.DefaultThreadCurrentCulture   = new CultureInfo("en-US");
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");
            XmlLanguage lang = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);

            FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(lang));
            FrameworkContentElement.LanguageProperty.OverrideMetadata(typeof(System.Windows.Documents.TextElement), new FrameworkPropertyMetadata(lang));

            InitializeComponent();

            logger = LogManager.GetCurrentClassLogger();

            prajuritDatabase            = new PrajuritDatabase();
            prajurits                   = new List <Prajurit>();
            pesertaDataGrid.DataContext = prajurits;
            senjatas = new Dictionary <int, Senjata>();

            recorder           = new EventsRecorder();
            liveGameController = new LiveGameController(this);
            replayController   = new ReplayGameController(this);
            watchController    = new WatchGameController(this);

            mapDrawer = new MapDrawer(map, prajurits);
            mapDrawer.setVisibility(showACheckBox.IsChecked.Value, showBCheckBox.IsChecked.Value); //check checkbox Tim
        }
示例#2
0
 public AbstractGameController(MainWindow parent, UDPCommunication communication, EventsRecorder recorder)
 {
     this.communication    = communication;
     this.parent           = parent;
     this.prajurits        = parent.prajurits;
     this.senjatas         = parent.senjatas;
     this.recorder         = recorder;
     this.prajuritDatabase = parent.prajuritDatabase;
     this.watchers         = new List <IPAddress>();
 }