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(); }
public void AddCandidate(Mobile mob) { if (IsCandidate(mob)) { return; } m_Candidates.Add(new Candidate(mob)); mob.SendLocalizedMessage(1010117); // You are now running for office. }
public void AddCandidate(Mobile mob) { if (IsCandidate(mob)) { return; } m_Candidates.Add(new Candidate(mob)); mob.SendAsciiMessage("You are now running for office."); }
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(); }