public PartialVariableModel GetVariableModel()
 {
     PartialVariableModel vars = new PartialVariableModel();
     ObservableCollection<PartialPlayerValueModel> players = new ObservableCollection<PartialPlayerValueModel>();
     foreach (TreePartialPlayerVariable player in Players)
         players.Add(player.GetPlayerModel());
     vars.Default = Default;
     vars.Variable = Variable;
     vars.Name = ID;
     vars.Players = players;
     return vars;
 }
Esempio n. 2
0
        public PartialVariableListModel LoadVariables(BetTreeNodeModel Node)
        {
            int numPlayers = Node.Snapshot.Active.Count(x => x);
            Variables = new PartialVariableListModel();
            ObservableCollection<PartialVariableModel> defs = new ObservableCollection<PartialVariableModel>();
            foreach (TreePartialVariableDefinition[] defSet in _variables)
            {
                foreach (TreePartialVariableDefinition defSingle in defSet)
                {
                    PartialVariableModel var = new PartialVariableModel() { Name = defSingle.ID, Variable = defSingle.Variable, Default = defSingle.Default };
                    ObservableCollection<PartialPlayerValueModel> players = new ObservableCollection<PartialPlayerValueModel>();
                    for (int i = 0; i < numPlayers; i++)
                        players.Add(new PartialPlayerValueModel() { Index = i });
                    var.Players = players;
                    defs.Add(var);
                }
            }

            Variables.Definitions = defs;
            return Variables;
        }