// Path: app/src/main/java/se/oort/diplicity/apigen/Game.java
// public class Game implements java.io.Serializable {
//   public String ID;
//   public Boolean Started;
//   public Boolean Closed;
//   public Boolean Finished;
//   public String Desc;
//   public String Variant;
//   public Long PhaseLengthMinutes;
//   public Long NonMovementPhaseLengthMinutes;
//   public Double MaxHated;
//   public Double MaxHater;
//   public Double MinRating;
//   public Double MaxRating;
//   public Double MinReliability;
//   public Double MinQuickness;
//   public Boolean Private;
//   public Boolean NoMerge;
//   public Boolean DisableConferenceChat;
//   public Boolean DisableGroupChat;
//   public Boolean DisablePrivateChat;
//   public Long NationAllocation;
//   public Boolean Anonymous;
//   public Long LastYear;
//   public Long NMembers;
//   public java.util.List<Member> Members;
//   public java.util.Date StartETA;
//   public java.util.List<PhaseMeta> NewestPhaseMeta;
//   public java.util.List<Ban> ActiveBans;
//   public java.util.List<String> FailedRequirements;
//   public Member FirstMember;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date StartedAt;
//   public Ticker StartedAgo;
//   public java.util.Date FinishedAt;
//   public Ticker FinishedAgo;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/GameScore.java
// public class GameScore implements java.io.Serializable {
//   public String UserId;
//   public String Member;
//   public Long SCs;
//   public Double Score;
//   public String Explanation;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/Member.java
// public class Member implements java.io.Serializable {
//   public User User;
//   public String Nation;
//   public String GameAlias;
//   public String NationPreferences;
//   public PhaseState NewestPhaseState;
//   public Long UnreadMessages;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseMeta.java
// public class PhaseMeta implements java.io.Serializable {
//   public Long PhaseOrdinal;
//   public String Season;
//   public Long Year;
//   public String Type;
//   public Boolean Resolved;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date ResolvedAt;
//   public Ticker ResolvedAgo;
//   public java.util.Date DeadlineAt;
//   public Ticker NextDeadlineIn;
//   public String UnitsJSON;
//   public String SCsJSON;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseState.java
// public class PhaseState implements java.io.Serializable {
//   public String GameID;
//   public Long PhaseOrdinal;
//   public String Nation;
//   public Boolean ReadyToResolve;
//   public Boolean WantsDIAS;
//   public Boolean OnProbation;
//   public Boolean NoOrders;
//   public Boolean Eliminated;
//   public String Messages;
//   public String Note;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/SingleContainer.java
// public class SingleContainer<T> implements java.io.Serializable {
//   public SingleContainer() {
//   }
//   public T Properties;
//   public java.util.List<Link> Links;
//   public String name;
//   public java.util.List<java.util.List<String>> Desc;
// }


import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import retrofit2.adapter.rxjava.HttpException;
import se.oort.diplicity.apigen.Game;
import se.oort.diplicity.apigen.GameScore;
import se.oort.diplicity.apigen.Member;
import se.oort.diplicity.apigen.PhaseMeta;
import se.oort.diplicity.apigen.PhaseState;
import se.oort.diplicity.apigen.SingleContainer;
                    wantsDIAS.setChecked(finalFoundState.WantsDIAS);
                    if (!foundState.Eliminated && !phaseMeta.Resolved && retrofitActivity.getLoggedInUser().Id.equals(member.User.Id)) {
                        wantsDIAS.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                                finalFoundState.WantsDIAS = b;
                                retrofitActivity.handleReq(
                                        retrofitActivity.phaseStateService.PhaseStateUpdate(finalFoundState, MemberTable.this.game.ID, phaseMeta.PhaseOrdinal.toString()),
                                        new Sendable<SingleContainer<PhaseState>>() {
                                            @Override
                                            public void send(SingleContainer<PhaseState> phaseStateSingleContainer) {
                                                onProbation.setChecked(false);
                                            }
                                        },
                                        new RetrofitActivity.ErrorHandler(new Sendable<Object>() {
                                            @Override
                                            public void send(Object o) {
                                                wantsDIAS.setChecked(finalFoundState.WantsDIAS);
                                            }
                                        }),
                                        getResources().getString(R.string.updating_phase_state));
                            }
                        });
                    } else {
                        wantsDIAS.setEnabled(false);
                    }
                    tableRow.addView(wantsDIAS);
                    onProbation.setText(R.string.nmr);
                    onProbation.setLayoutParams(wrapContentParams);
                    onProbation.setChecked(finalFoundState.OnProbation);
// Path: app/src/main/java/se/oort/diplicity/apigen/Game.java
// public class Game implements java.io.Serializable {
//   public String ID;
//   public Boolean Started;
//   public Boolean Closed;
//   public Boolean Finished;
//   public String Desc;
//   public String Variant;
//   public Long PhaseLengthMinutes;
//   public Long NonMovementPhaseLengthMinutes;
//   public Double MaxHated;
//   public Double MaxHater;
//   public Double MinRating;
//   public Double MaxRating;
//   public Double MinReliability;
//   public Double MinQuickness;
//   public Boolean Private;
//   public Boolean NoMerge;
//   public Boolean DisableConferenceChat;
//   public Boolean DisableGroupChat;
//   public Boolean DisablePrivateChat;
//   public Long NationAllocation;
//   public Boolean Anonymous;
//   public Long LastYear;
//   public Long NMembers;
//   public java.util.List<Member> Members;
//   public java.util.Date StartETA;
//   public java.util.List<PhaseMeta> NewestPhaseMeta;
//   public java.util.List<Ban> ActiveBans;
//   public java.util.List<String> FailedRequirements;
//   public Member FirstMember;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date StartedAt;
//   public Ticker StartedAgo;
//   public java.util.Date FinishedAt;
//   public Ticker FinishedAgo;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/GameScore.java
// public class GameScore implements java.io.Serializable {
//   public String UserId;
//   public String Member;
//   public Long SCs;
//   public Double Score;
//   public String Explanation;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/Member.java
// public class Member implements java.io.Serializable {
//   public User User;
//   public String Nation;
//   public String GameAlias;
//   public String NationPreferences;
//   public PhaseState NewestPhaseState;
//   public Long UnreadMessages;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseMeta.java
// public class PhaseMeta implements java.io.Serializable {
//   public Long PhaseOrdinal;
//   public String Season;
//   public Long Year;
//   public String Type;
//   public Boolean Resolved;
//   public java.util.Date CreatedAt;
//   public Ticker CreatedAgo;
//   public java.util.Date ResolvedAt;
//   public Ticker ResolvedAgo;
//   public java.util.Date DeadlineAt;
//   public Ticker NextDeadlineIn;
//   public String UnitsJSON;
//   public String SCsJSON;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/PhaseState.java
// public class PhaseState implements java.io.Serializable {
//   public String GameID;
//   public Long PhaseOrdinal;
//   public String Nation;
//   public Boolean ReadyToResolve;
//   public Boolean WantsDIAS;
//   public Boolean OnProbation;
//   public Boolean NoOrders;
//   public Boolean Eliminated;
//   public String Messages;
//   public String Note;
// }
// 
// Path: app/src/main/java/se/oort/diplicity/apigen/SingleContainer.java
// public class SingleContainer<T> implements java.io.Serializable {
//   public SingleContainer() {
//   }
//   public T Properties;
//   public java.util.List<Link> Links;
//   public String name;
//   public java.util.List<java.util.List<String>> Desc;
// }


// Path: app/src/main/java/se/oort/diplicity/MemberTable.java
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import retrofit2.adapter.rxjava.HttpException;
import se.oort.diplicity.apigen.Game;
import se.oort.diplicity.apigen.GameScore;
import se.oort.diplicity.apigen.Member;
import se.oort.diplicity.apigen.PhaseMeta;
import se.oort.diplicity.apigen.PhaseState;
import se.oort.diplicity.apigen.SingleContainer;

                    wantsDIAS.setChecked(finalFoundState.WantsDIAS);
                    if (!foundState.Eliminated && !phaseMeta.Resolved && retrofitActivity.getLoggedInUser().Id.equals(member.User.Id)) {
                        wantsDIAS.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                            @Override
                            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                                finalFoundState.WantsDIAS = b;
                                retrofitActivity.handleReq(
                                        retrofitActivity.phaseStateService.PhaseStateUpdate(finalFoundState, MemberTable.this.game.ID, phaseMeta.PhaseOrdinal.toString()),
                                        new Sendable<SingleContainer<PhaseState>>() {
                                            @Override
                                            public void send(SingleContainer<PhaseState> phaseStateSingleContainer) {
                                                onProbation.setChecked(false);
                                            }
                                        },
                                        new RetrofitActivity.ErrorHandler(new Sendable<Object>() {
                                            @Override
                                            public void send(Object o) {
                                                wantsDIAS.setChecked(finalFoundState.WantsDIAS);
                                            }
                                        }),
                                        getResources().getString(R.string.updating_phase_state));
                            }
                        });
                    } else {
                        wantsDIAS.setEnabled(false);
                    }
                    tableRow.addView(wantsDIAS);
                    onProbation.setText(R.string.nmr);
                    onProbation.setLayoutParams(wrapContentParams);
                    onProbation.setChecked(finalFoundState.OnProbation);
                    onProbation.setEnabled(false);