Ejemplo n.º 1
0
 public GameV()
 {
     int num = 3;
     int sNum = 2;
     int rNum = 3;
     gameVM = new GameVM(num, rNum, sNum);
     InitializeComponent();
     DataContext = gameVM;
     myCitadel.DataContext = gameVM.GamePlayerList[sNum - 1];
     switch (num)
     {
         case 2:
             upCitadel.DataContext = gameVM.GamePlayerList[2 - sNum];
             break;
         case 3:
             leftCitadel.DataContext = gameVM.GamePlayerList[sNum % 3];
             rightCitadel.DataContext = gameVM.GamePlayerList[(sNum + 1) % 3];
             break;
         case 4:
             leftCitadel.DataContext = gameVM.GamePlayerList[sNum % 4];
             upCitadel.DataContext = gameVM.GamePlayerList[(sNum + 1) % 4];
             rightCitadel.DataContext = gameVM.GamePlayerList[(sNum + 2) % 4];
             break;
     }
 }
Ejemplo n.º 2
0
 public GameV(int num,int roomNum, int seatNum)
 {
     gameVM = new GameVM(num,roomNum, seatNum);
     DataContext = gameVM;
     InitializeComponent();
     myCitadel.DataContext = gameVM.GamePlayerList[seatNum - 1];
     switch (num)
     {
         case 2:
             upCitadel.DataContext = gameVM.GamePlayerList[2 - seatNum];
             leftCitadel.Visibility = Visibility.Collapsed;
             rightCitadel.Visibility = Visibility.Collapsed;
             break;
         case 3:
             leftCitadel.DataContext = gameVM.GamePlayerList[seatNum % 3];
             rightCitadel.DataContext = gameVM.GamePlayerList[(seatNum + 1) % 3];
             upCitadel.Visibility = Visibility.Collapsed;
             break;
         case 4:
             leftCitadel.DataContext = gameVM.GamePlayerList[seatNum % 4];
             upCitadel.DataContext = gameVM.GamePlayerList[(seatNum + 1) % 4];
             rightCitadel.DataContext = gameVM.GamePlayerList[(seatNum + 2) % 4];
             break;
     }
 }