Esempio n. 1
0
 void Control_PlayerPhone_Loaded(object sender, RoutedEventArgs e)
 {
     _vm_Player = (VM_Player)LayoutRoot.DataContext;
     _vm_Player.Visual = this;
     PlayerStateChanged(_vm_Player);
     _vm_Player.SubscribeToChange(() => _vm_Player.State, PlayerStateChanged);
 }
Esempio n. 2
0
File: VM.cs Progetto: dcsan/frennzy
        public VM()
        {
            VM_Player host = new VM_Player("HostBoy", GameStates.Initial, this, true);
            Phones.Add(new VM_Phone(host));
            Players.Add(host);

            Games.CollectionChanged += new NotifyCollectionChangedEventHandler(Games_CollectionChanged);

            VM_Player hiro = new VM_Player("Hiro", GameStates.AddPlayers, this);
            Phones.Add(new VM_Phone(hiro));
            Players.Add(hiro);

            //Players.Add(new VM_Player("n00b"));

            StatementDB.Add(new VM_Statement(true, "The Nobel Peace Prize medal depicts 3 naked men with their hands on each others shoulders.", "http://www.weirdfacts.com/facts/3118-nobel-prize.html"));
            StatementDB.Add(new VM_Statement(true, "Fortune cookies were actually invented in America.", "http://www.weirdfacts.com/facts/3119-fortune-cookies.html"));
            StatementDB.Add(new VM_Statement(true, "The cigarette lighter was invented before the match.", "http://www.weirdfacts.com/facts/3126-matches-and-lighters.html"));
            StatementDB.Add(new VM_Statement(true, "The chances of you dying on the way to get your lottery tickets is greater than your chances of winning.", ""));
            StatementDB.Add(new VM_Statement(true, "The longest recorded sneezing fit lasted 978 days.", "http://www.weirdfacts.com/facts/3253-sneeze-facts.html"));
            StatementDB.Add(new VM_Statement(true, "Dr. Ruth was trained as a sniper.", "http://en.wikipedia.org/wiki/Ruth_Westheimer"));
            StatementDB.Add(new VM_Statement(true, "Hot water freezes faster than cold water.", "http://en.wikipedia.org/wiki/Mpemba_effect"));
            StatementDB.Add(new VM_Statement(true, "The mortal remains of Charlie Chaplin were stolen and held for randsom.", "http://www.snopes.com/movies/actors/chaplin1.asp"));
            StatementDB.Add(new VM_Statement(true, "Japanese robbers sent a 'thank you' note to the bank after robbing it.", "http://www.snopes.com/crime/clever/thanks.asp"));
            StatementDB.Add(new VM_Statement(true, "Three streakers had their car stolen while running nude through a restaurant.", "http://www.snopes.com/crime/deserts/streaker.asp"));
            StatementDB.Add(new VM_Statement(true, "Mr. Ed was actually a zebra.", "http://www.snopes.com/lost/mistered.asp"));
            StatementDB.Add(new VM_Statement(true, "The California flag was supposed to have a pear, but due to a typo ended up with a 'bear'.", "http://www.snopes.com/lost/bearflag.asp"));
            StatementDB.Add(new VM_Statement(true, "The nursery rhyme \"Sing a Song of Sixpence\" was originally for secretly recruiting pirates.", "http://www.snopes.com/lost/sixpence.asp"));
            StatementDB.Add(new VM_Statement(true, "An insect-infested house was blown apart after the owner set off too many bug bombs.", "http://www.snopes.com/humor/follies/bugbomb.asp"));
            StatementDB.Add(new VM_Statement(true, "The Swedish Navy once mistook minks for enemy submarines.", "http://www.snopes.com/critters/gnus/slink.asp"));
            StatementDB.Add(new VM_Statement(true, "Snakes have been used as weapons in a hold-up.", "http://www.snopes.com/critters/gnus/snakerob.asp"));
            StatementDB.Add(new VM_Statement(true, "A number of unusual deaths have surrounded the cast of the Poltergeist films.", "http://www.snopes.com/movies/films/poltergeist.asp"));
            StatementDB.Add(new VM_Statement(true, "Kid finances college by soliciting one-cent donations.", "http://www.snopes.com/college/admin/cent.asp"));
            StatementDB.Add(new VM_Statement(true, "The temperature outside can be determined by counting the chirps a cricket makes.", "http://www.snopes.com/science/cricket.asp"));
            StatementDB.Add(new VM_Statement(true, "The middle name of Harry Truman is actually just the letter 'S'.", "http://www.snopes.com/history/american/truman.asp"));
            StatementDB.Add(new VM_Statement(false, "The phrase \"rule of thumb\" is derived from an old English law that stated that you couldn't beat your wife with anything wider than your thumb.", "http://www.weirdfacts.com/facts/3135-rule-of-thumb.html"));
            StatementDB.Add(new VM_Statement(false, "The name Jeep came from the abbreviation used in the army for the General Purpose\" vehicle or \"GP\".", "http://wwiijeepparts.com/Archives/WWIIJeepHistory.html"));
            StatementDB.Add(new VM_Statement(false, "The venomous 'two-striped telemonia spider lurks beneath toilet seats in public restrooms.", "http://www.snopes.com/horrors/insects/telamonia.asp"));
            StatementDB.Add(new VM_Statement(false, "Man insured cigars against fire, then tried to collect after smoking them.", "http://www.snopes.com/crime/clever/cigarson.asp"));
            StatementDB.Add(new VM_Statement(false, "Hair grows back darker and thicker after being shaved.", "http://www.snopes.com/oldwives/hairgrow.asp"));
            StatementDB.Add(new VM_Statement(false, "Chewing gum takes 7 years to be digested.", "http://www.snopes.com/oldwives/chewgum.asp"));
            StatementDB.Add(new VM_Statement(false, "Swimming less than an hour after eating can cause you to get cramps and drown.", "http://www.snopes.com/oldwives/hourwait.asp"));
            StatementDB.Add(new VM_Statement(false, "The Titanic was the first ship to send the 'SOS' distress call.", "http://www.snopes.com/history/titanic/sos.asp"));
            StatementDB.Add(new VM_Statement(false, "There is a sanctuary for dogs named 'Dog Island' off the coast of Florida.", "http://www.snopes.com/critters/crusader/dogisland.asp"));
            StatementDB.Add(new VM_Statement(false, "Coating the edges of an audio CD with a green marker notably improves the sound.", "http://www.snopes.com/music/media/marker.asp"));

            Players.CollectionChanged += new NotifyCollectionChangedEventHandler(Players_CollectionChanged);
        }
Esempio n. 3
0
File: VM.cs Progetto: dcsan/frennzy
        private void RemovePhone(VM_Player player)
        {
            VM_Phone playersPhone = GetPlayerPhone(player);

            if (playersPhone != null)
                Phones.Remove(playersPhone);
        }
Esempio n. 4
0
File: VM.cs Progetto: dcsan/frennzy
        private VM_Phone GetPlayerPhone(VM_Player player)
        {
            foreach (VM_Phone phone in Phones)
                if (phone.Owner == player)
                    return phone;

            return null;
        }
Esempio n. 5
0
File: VM.cs Progetto: dcsan/frennzy
 public void RemovePlayer(VM_Player player)
 {
     RemovePhone(player);
     Players.Remove(player);
 }
Esempio n. 6
0
File: VM.cs Progetto: dcsan/frennzy
 public void GoTo_AddPhone(VM_Player player)
 {
     NewPhone = new VM_Phone(player);
     Host.State = GameStates.AddPhone;
 }
Esempio n. 7
0
File: VM.cs Progetto: dcsan/frennzy
 public void AddPhone(VM_Player player)
 {
     Phones.Add(new VM_Phone(player));
 }
Esempio n. 8
0
 public VM_Round(VM_Player speaker, ObservableCollection<VM_Statement> options)
 {
     Speaker = speaker;
     Options = options;
 }
Esempio n. 9
0
 public void EnterVote(VM_Player player, bool vote)
 {
     player.Vote = vote;
     player.State = GameStates.WaitForResults;
     _votedList.Add(player);
     EndRound();
 }
Esempio n. 10
0
 private void PlayerStateChanged(VM_Player player)
 {
     VisualStateManager.GoToState(player.Visual, player.State.ToString(), true);
 }
Esempio n. 11
0
 public VM_Phone(VM_Player owner)
 {
     Owner = owner;
     Players.Add(owner);
 }