Exemplo n.º 1
0
        public Election(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 0:
            {
                m_Faction = Faction.ReadReference(reader);

                m_LastStateTime = reader.ReadDateTime();
                m_State         = (ElectionState)reader.ReadEncodedInt();

                m_Candidates = new CandidateCollection();

                int count = reader.ReadEncodedInt();

                for (int i = 0; i < count; ++i)
                {
                    Candidate cd = new Candidate(reader);

                    if (cd.Mobile != null)
                    {
                        m_Candidates.Add(cd);
                    }
                }

                break;
            }
            }

            StartTimer();
        }
Exemplo n.º 2
0
        public void AddCandidate(Mobile mob)
        {
            if (IsCandidate(mob))
            {
                return;
            }

            m_Candidates.Add(new Candidate(mob));
            mob.SendLocalizedMessage(1010117);               // You are now running for office.
        }
Exemplo n.º 3
0
        public void AddCandidate(Mobile mob)
        {
            if (IsCandidate(mob))
            {
                return;
            }

            m_Candidates.Add(new Candidate(mob));
            mob.SendAsciiMessage("You are now running for office.");
        }
Exemplo n.º 4
0
		public Election( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					m_Faction = Faction.ReadReference( reader );

					m_LastStateTime = reader.ReadDateTime();
					m_State = (ElectionState)reader.ReadEncodedInt();

					m_Candidates = new CandidateCollection();

					int count = reader.ReadEncodedInt();

					for ( int i = 0; i < count; ++i )
					{
						Candidate cd = new Candidate( reader );

						if ( cd.Mobile != null )
							m_Candidates.Add( cd );
					}

					break;
				}
			}

			StartTimer();
		}