This commit is contained in:
parent
a9c90da627
commit
8150706a3c
31 changed files with 145 additions and 2716 deletions
|
|
@ -3,6 +3,7 @@ using System.Net;
|
|||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -16,14 +17,14 @@ namespace Server.Factions
|
|||
public const int CandidateRank = 5;
|
||||
|
||||
private Faction m_Faction;
|
||||
private CandidateCollection m_Candidates;
|
||||
private List<Candidate> m_Candidates;
|
||||
|
||||
private ElectionState m_State;
|
||||
private DateTime m_LastStateTime;
|
||||
|
||||
public Faction Faction{ get{ return m_Faction; } }
|
||||
|
||||
public CandidateCollection Candidates{ get{ return m_Candidates; } }
|
||||
public List<Candidate> Candidates { get { return m_Candidates; } }
|
||||
|
||||
public ElectionState State{ get{ return m_State; } set{ m_State = value; m_LastStateTime = DateTime.Now; } }
|
||||
public DateTime LastStateTime{ get{ return m_LastStateTime; } }
|
||||
|
|
@ -79,7 +80,7 @@ namespace Server.Factions
|
|||
public Election( Faction faction )
|
||||
{
|
||||
m_Faction = faction;
|
||||
m_Candidates = new CandidateCollection();
|
||||
m_Candidates = new List<Candidate>();
|
||||
|
||||
StartTimer();
|
||||
}
|
||||
|
|
@ -97,7 +98,7 @@ namespace Server.Factions
|
|||
m_LastStateTime = reader.ReadDateTime();
|
||||
m_State = (ElectionState)reader.ReadEncodedInt();
|
||||
|
||||
m_Candidates = new CandidateCollection();
|
||||
m_Candidates = new List<Candidate>();
|
||||
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
|
|
@ -146,11 +147,11 @@ namespace Server.Factions
|
|||
{
|
||||
for ( int i = 0; i < m_Candidates.Count; ++i )
|
||||
{
|
||||
ArrayList voters = m_Candidates[i].Voters;
|
||||
List<Voter> voters = m_Candidates[i].Voters;
|
||||
|
||||
for ( int j = 0; j < voters.Count; ++j )
|
||||
{
|
||||
Voter voter = (Voter)voters[j];
|
||||
Voter voter = voters[j];
|
||||
|
||||
if ( voter.From == mob )
|
||||
voters.RemoveAt( j-- );
|
||||
|
|
@ -233,11 +234,11 @@ namespace Server.Factions
|
|||
{
|
||||
for ( int i = 0; i < m_Candidates.Count; ++i )
|
||||
{
|
||||
ArrayList voters = m_Candidates[i].Voters;
|
||||
List<Voter> voters = m_Candidates[i].Voters;
|
||||
|
||||
for ( int j = 0; j < voters.Count; ++j )
|
||||
{
|
||||
Voter voter = (Voter)voters[j];
|
||||
Voter voter = voters[j];
|
||||
|
||||
if ( voter.From == mob )
|
||||
return m_Candidates[i];
|
||||
|
|
@ -479,10 +480,10 @@ namespace Server.Factions
|
|||
public class Candidate
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private ArrayList m_Voters;
|
||||
private List<Voter> m_Voters;
|
||||
|
||||
public Mobile Mobile{ get{ return m_Mobile; } }
|
||||
public ArrayList Voters{ get{ return m_Voters; } }
|
||||
public List<Voter> Voters { get { return m_Voters; } }
|
||||
|
||||
public int Votes{ get{ return m_Voters.Count; } }
|
||||
|
||||
|
|
@ -500,7 +501,7 @@ namespace Server.Factions
|
|||
public Candidate( Mobile mob )
|
||||
{
|
||||
m_Mobile = mob;
|
||||
m_Voters = new ArrayList();
|
||||
m_Voters = new List<Voter>();
|
||||
}
|
||||
|
||||
public Candidate( GenericReader reader )
|
||||
|
|
@ -514,7 +515,7 @@ namespace Server.Factions
|
|||
m_Mobile = reader.ReadMobile();
|
||||
|
||||
int count = reader.ReadEncodedInt();
|
||||
m_Voters = new ArrayList( count );
|
||||
m_Voters = new List<Voter>( count );
|
||||
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
|
|
@ -530,11 +531,11 @@ namespace Server.Factions
|
|||
{
|
||||
m_Mobile = reader.ReadMobile();
|
||||
|
||||
ArrayList mobs = reader.ReadMobileList();
|
||||
m_Voters = new ArrayList( mobs.Count );
|
||||
List<Mobile> mobs = reader.ReadStrongMobileList();
|
||||
m_Voters = new List<Voter>( mobs.Count );
|
||||
|
||||
for ( int i = 0; i < mobs.Count; ++i )
|
||||
m_Voters.Add( new Voter( (Mobile)mobs[i], m_Mobile ) );
|
||||
m_Voters.Add( new Voter( mobs[i], m_Mobile ) );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using Server.Targeting;
|
|||
using Server.Accounting;
|
||||
using Server.Commands;
|
||||
using Server.Commands.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -65,7 +66,7 @@ namespace Server.Factions
|
|||
set{ m_State.Silver = value; }
|
||||
}
|
||||
|
||||
public PlayerStateCollection Members
|
||||
public List<PlayerState> Members
|
||||
{
|
||||
get{ return m_State.Members; }
|
||||
set{ m_State.Members = value; }
|
||||
|
|
@ -85,7 +86,7 @@ namespace Server.Factions
|
|||
|
||||
public void Broadcast( int hue, string text )
|
||||
{
|
||||
PlayerStateCollection members = Members;
|
||||
List<PlayerState> members = Members;
|
||||
|
||||
for ( int i = 0; i < members.Count; ++i )
|
||||
members[i].Mobile.SendMessage( hue, text );
|
||||
|
|
@ -93,7 +94,7 @@ namespace Server.Factions
|
|||
|
||||
public void Broadcast( int number )
|
||||
{
|
||||
PlayerStateCollection members = Members;
|
||||
List<PlayerState> members = Members;
|
||||
|
||||
for ( int i = 0; i < members.Count; ++i )
|
||||
members[i].Mobile.SendLocalizedMessage( number );
|
||||
|
|
@ -428,7 +429,7 @@ namespace Server.Factions
|
|||
pm.SendLocalizedMessage( 1018031 ); // In the interest of faction stability, this faction declines to accept new members for now.
|
||||
else
|
||||
{
|
||||
ArrayList members = new ArrayList( guild.Members );
|
||||
List<Mobile> members = new List<Mobile>( guild.Members );
|
||||
|
||||
for ( int i = 0; i < members.Count; ++i )
|
||||
{
|
||||
|
|
@ -497,9 +498,9 @@ namespace Server.Factions
|
|||
|
||||
public void UpdateRanks()
|
||||
{
|
||||
PlayerStateCollection members = Members;
|
||||
List<PlayerState> members = Members;
|
||||
|
||||
ArrayList list = new ArrayList( members );
|
||||
List<PlayerState> list = new List<PlayerState>( members );
|
||||
|
||||
list.Sort();
|
||||
|
||||
|
|
@ -507,7 +508,7 @@ namespace Server.Factions
|
|||
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
{
|
||||
PlayerState pl = (PlayerState)list[i];
|
||||
PlayerState pl = list[i];
|
||||
|
||||
int percent;
|
||||
|
||||
|
|
@ -553,12 +554,12 @@ namespace Server.Factions
|
|||
|
||||
public static void FactionTownReset_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
MonolithCollection monoliths = BaseMonolith.Monoliths;
|
||||
List<BaseMonolith> monoliths = BaseMonolith.Monoliths;
|
||||
|
||||
for ( int i = 0; i < monoliths.Count; ++i )
|
||||
monoliths[i].Sigil = null;
|
||||
|
||||
TownCollection towns = Town.Towns;
|
||||
List<Town> towns = Town.Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
@ -569,7 +570,7 @@ namespace Server.Factions
|
|||
towns[i].Owner = null;
|
||||
}
|
||||
|
||||
SigilCollection sigils = Sigil.Sigils;
|
||||
List<Sigil> sigils = Sigil.Sigils;
|
||||
|
||||
for ( int i = 0; i < sigils.Count; ++i )
|
||||
{
|
||||
|
|
@ -583,17 +584,17 @@ namespace Server.Factions
|
|||
sigils[i].ReturnHome();
|
||||
}
|
||||
|
||||
FactionCollection factions = Faction.Factions;
|
||||
List<Faction> factions = Faction.Factions;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
{
|
||||
Faction f = factions[i];
|
||||
|
||||
ArrayList list = new ArrayList( f.State.FactionItems );
|
||||
List<FactionItem> list = new List<FactionItem>( f.State.FactionItems );
|
||||
|
||||
for ( int j = 0; j < list.Count; ++j )
|
||||
{
|
||||
FactionItem fi = (FactionItem)list[j];
|
||||
FactionItem fi = list[j];
|
||||
|
||||
if ( fi.Expiration == DateTime.MinValue )
|
||||
fi.Item.Delete();
|
||||
|
|
@ -605,12 +606,12 @@ namespace Server.Factions
|
|||
|
||||
public static void FactionReset_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
MonolithCollection monoliths = BaseMonolith.Monoliths;
|
||||
List<BaseMonolith> monoliths = BaseMonolith.Monoliths;
|
||||
|
||||
for ( int i = 0; i < monoliths.Count; ++i )
|
||||
monoliths[i].Sigil = null;
|
||||
|
||||
TownCollection towns = Town.Towns;
|
||||
List<Town> towns = Town.Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
@ -621,7 +622,7 @@ namespace Server.Factions
|
|||
towns[i].Owner = null;
|
||||
}
|
||||
|
||||
SigilCollection sigils = Sigil.Sigils;
|
||||
List<Sigil> sigils = Sigil.Sigils;
|
||||
|
||||
for ( int i = 0; i < sigils.Count; ++i )
|
||||
{
|
||||
|
|
@ -635,22 +636,22 @@ namespace Server.Factions
|
|||
sigils[i].ReturnHome();
|
||||
}
|
||||
|
||||
FactionCollection factions = Faction.Factions;
|
||||
List<Faction> factions = Faction.Factions;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
{
|
||||
Faction f = factions[i];
|
||||
|
||||
ArrayList list = new ArrayList( f.Members );
|
||||
List<PlayerState> playerStateList = new List<PlayerState>( f.Members );
|
||||
|
||||
for ( int j = 0; j < list.Count; ++j )
|
||||
f.RemoveMember( ((PlayerState)list[j]).Mobile );
|
||||
for( int j = 0; j < playerStateList.Count; ++j )
|
||||
f.RemoveMember( playerStateList[j].Mobile );
|
||||
|
||||
list = new ArrayList( f.State.FactionItems );
|
||||
List<FactionItem> factionItemList = new List<FactionItem>( f.State.FactionItems );
|
||||
|
||||
for ( int j = 0; j < list.Count; ++j )
|
||||
for( int j = 0; j < factionItemList.Count; ++j )
|
||||
{
|
||||
FactionItem fi = (FactionItem)list[j];
|
||||
FactionItem fi = (FactionItem)factionItemList[j];
|
||||
|
||||
if ( fi.Expiration == DateTime.MinValue )
|
||||
fi.Item.Delete();
|
||||
|
|
@ -658,10 +659,10 @@ namespace Server.Factions
|
|||
fi.Detach();
|
||||
}
|
||||
|
||||
list = new ArrayList( f.Traps );
|
||||
List<BaseFactionTrap> factionTrapList = new List<BaseFactionTrap>( f.Traps );
|
||||
|
||||
for ( int j = 0; j < list.Count; ++j )
|
||||
((BaseFactionTrap)list[j]).Delete();
|
||||
for( int j = 0; j < factionTrapList.Count; ++j )
|
||||
factionTrapList[j].Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -800,7 +801,7 @@ namespace Server.Factions
|
|||
|
||||
public static void ProcessTick()
|
||||
{
|
||||
SigilCollection sigils = Sigil.Sigils;
|
||||
List<Sigil> sigils = Sigil.Sigils;
|
||||
|
||||
for ( int i = 0; i < sigils.Count; ++i )
|
||||
{
|
||||
|
|
@ -936,7 +937,7 @@ namespace Server.Factions
|
|||
|
||||
public virtual int MaximumTraps{ get{ return 15; } }
|
||||
|
||||
public FactionTrapCollection Traps
|
||||
public List<BaseFactionTrap> Traps
|
||||
{
|
||||
get{ return m_State.Traps; }
|
||||
set{ m_State.Traps = value; }
|
||||
|
|
@ -947,7 +948,7 @@ namespace Server.Factions
|
|||
|
||||
public static Faction FindSmallestFaction()
|
||||
{
|
||||
FactionCollection factions = Factions;
|
||||
List<Faction> factions = Factions;
|
||||
Faction smallest = null;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
|
|
@ -963,7 +964,7 @@ namespace Server.Factions
|
|||
|
||||
public static bool StabilityActive()
|
||||
{
|
||||
FactionCollection factions = Factions;
|
||||
List<Faction> factions = Factions;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
{
|
||||
|
|
@ -1191,7 +1192,7 @@ namespace Server.Factions
|
|||
writer.WriteEncodedInt( (int) (idx + 1) );
|
||||
}
|
||||
|
||||
public static FactionCollection Factions{ get{ return Reflector.Factions; } }
|
||||
public static List<Faction> Factions{ get{ return Reflector.Factions; } }
|
||||
|
||||
public static Faction ReadReference( GenericReader reader )
|
||||
{
|
||||
|
|
@ -1239,7 +1240,7 @@ namespace Server.Factions
|
|||
|
||||
public static Faction Parse( string name )
|
||||
{
|
||||
FactionCollection factions = Factions;
|
||||
List<Faction> factions = Factions;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -8,10 +9,10 @@ namespace Server.Factions
|
|||
private Mobile m_Commander;
|
||||
private int m_Tithe;
|
||||
private int m_Silver;
|
||||
private PlayerStateCollection m_Members;
|
||||
private List<PlayerState> m_Members;
|
||||
private Election m_Election;
|
||||
private FactionItemCollection m_FactionItems;
|
||||
private FactionTrapCollection m_FactionTraps;
|
||||
private List<FactionItem> m_FactionItems;
|
||||
private List<BaseFactionTrap> m_FactionTraps;
|
||||
|
||||
private const int BroadcastsPerPeriod = 2;
|
||||
private static readonly TimeSpan BroadcastPeriod = TimeSpan.FromHours( 1.0 );
|
||||
|
|
@ -44,13 +45,13 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
public FactionItemCollection FactionItems
|
||||
public List<FactionItem> FactionItems
|
||||
{
|
||||
get{ return m_FactionItems; }
|
||||
set{ m_FactionItems = value; }
|
||||
}
|
||||
|
||||
public FactionTrapCollection Traps
|
||||
public List<BaseFactionTrap> Traps
|
||||
{
|
||||
get{ return m_FactionTraps; }
|
||||
set{ m_FactionTraps = value; }
|
||||
|
|
@ -101,7 +102,7 @@ namespace Server.Factions
|
|||
set{ m_Silver = value; }
|
||||
}
|
||||
|
||||
public PlayerStateCollection Members
|
||||
public List<PlayerState> Members
|
||||
{
|
||||
get{ return m_Members; }
|
||||
set{ m_Members = value; }
|
||||
|
|
@ -111,10 +112,10 @@ namespace Server.Factions
|
|||
{
|
||||
m_Faction = faction;
|
||||
m_Tithe = 50;
|
||||
m_Members = new PlayerStateCollection();
|
||||
m_Members = new List<PlayerState>();
|
||||
m_Election = new Election( faction );
|
||||
m_FactionItems = new FactionItemCollection();
|
||||
m_FactionTraps = new FactionTrapCollection();
|
||||
m_FactionItems = new List<FactionItem>();
|
||||
m_FactionTraps = new List<BaseFactionTrap>();
|
||||
}
|
||||
|
||||
public FactionState( GenericReader reader )
|
||||
|
|
@ -164,7 +165,7 @@ namespace Server.Factions
|
|||
|
||||
int memberCount = reader.ReadEncodedInt();
|
||||
|
||||
m_Members = new PlayerStateCollection();
|
||||
m_Members = new List<PlayerState>();
|
||||
|
||||
for ( int i = 0; i < memberCount; ++i )
|
||||
{
|
||||
|
|
@ -177,7 +178,7 @@ namespace Server.Factions
|
|||
m_Faction.State = this;
|
||||
m_Faction.UpdateRanks();
|
||||
|
||||
m_FactionItems = new FactionItemCollection();
|
||||
m_FactionItems = new List<FactionItem>();
|
||||
|
||||
if ( version >= 2 )
|
||||
{
|
||||
|
|
@ -194,7 +195,7 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
m_FactionTraps = new FactionTrapCollection();
|
||||
m_FactionTraps = new List<BaseFactionTrap>();
|
||||
|
||||
if ( version >= 3 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using Server.Commands;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -14,12 +15,12 @@ namespace Server.Factions
|
|||
{
|
||||
new FactionPersistance();
|
||||
|
||||
FactionCollection factions = Faction.Factions;
|
||||
List<Faction> factions = Faction.Factions;
|
||||
|
||||
foreach ( Faction faction in factions )
|
||||
Generate( faction );
|
||||
|
||||
TownCollection towns = Town.Towns;
|
||||
List<Town> towns = Town.Towns;
|
||||
|
||||
foreach ( Town town in towns )
|
||||
Generate( town );
|
||||
|
|
@ -46,7 +47,7 @@ namespace Server.Factions
|
|||
{
|
||||
Map facet = Faction.Facet;
|
||||
|
||||
TownCollection towns = Town.Towns;
|
||||
List<Town> towns = Town.Towns;
|
||||
|
||||
StrongholdDefinition stronghold = faction.Definition.Stronghold;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class GuardList
|
||||
{
|
||||
private GuardDefinition m_Definition;
|
||||
private FactionGuardCollection m_Guards;
|
||||
private List<BaseFactionGuard> m_Guards;
|
||||
|
||||
public GuardDefinition Definition{ get{ return m_Definition; } }
|
||||
public FactionGuardCollection Guards{ get{ return m_Guards; } }
|
||||
public List<BaseFactionGuard> Guards{ get{ return m_Guards; } }
|
||||
|
||||
public BaseFactionGuard Construct()
|
||||
{
|
||||
|
|
@ -20,7 +21,7 @@ namespace Server.Factions
|
|||
public GuardList( GuardDefinition definition )
|
||||
{
|
||||
m_Definition = definition;
|
||||
m_Guards = new FactionGuardCollection();
|
||||
m_Guards = new List<BaseFactionGuard>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -41,7 +42,7 @@ namespace Server.Factions
|
|||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
FactionCollection factions = Faction.Factions;
|
||||
List<Faction> factions = Faction.Factions;
|
||||
|
||||
for ( int i = 0; i < factions.Count; ++i )
|
||||
{
|
||||
|
|
@ -49,7 +50,7 @@ namespace Server.Factions
|
|||
factions[i].State.Serialize( writer );
|
||||
}
|
||||
|
||||
TownCollection towns = Town.Towns;
|
||||
List<Town> towns = Town.Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -8,25 +9,25 @@ namespace Server.Factions
|
|||
{
|
||||
private Mobile m_Mobile;
|
||||
private Faction m_Faction;
|
||||
private PlayerStateCollection m_Owner;
|
||||
private List<PlayerState> m_Owner;
|
||||
private int m_KillPoints;
|
||||
private DateTime m_Leaving;
|
||||
private MerchantTitle m_MerchantTitle;
|
||||
private RankDefinition m_Rank;
|
||||
private SilverGivenCollection m_SilverGiven;
|
||||
private List<SilverGivenEntry> m_SilverGiven;
|
||||
|
||||
private Town m_Sheriff;
|
||||
private Town m_Finance;
|
||||
|
||||
public Mobile Mobile{ get{ return m_Mobile; } }
|
||||
public Faction Faction{ get{ return m_Faction; } }
|
||||
public PlayerStateCollection Owner{ get{ return m_Owner; } }
|
||||
public List<PlayerState> Owner { get { return m_Owner; } }
|
||||
public int KillPoints{ get{ return m_KillPoints; } set{ m_KillPoints = value; } }
|
||||
public MerchantTitle MerchantTitle{ get{ return m_MerchantTitle; } set{ m_MerchantTitle = value; Invalidate(); } }
|
||||
public RankDefinition Rank{ get{ return m_Rank; } set{ m_Rank = value; Invalidate(); } }
|
||||
public Town Sheriff{ get{ return m_Sheriff; } set{ m_Sheriff = value; Invalidate(); } }
|
||||
public Town Finance{ get{ return m_Finance; } set{ m_Finance = value; Invalidate(); } }
|
||||
public SilverGivenCollection SilverGiven{ get{ return m_SilverGiven; } }
|
||||
public List<SilverGivenEntry> SilverGiven { get { return m_SilverGiven; } }
|
||||
|
||||
public DateTime Leaving{ get{ return m_Leaving; } set{ m_Leaving = value; } }
|
||||
public bool IsLeaving{ get{ return ( m_Leaving > DateTime.MinValue ); } }
|
||||
|
|
@ -52,7 +53,7 @@ namespace Server.Factions
|
|||
public void OnGivenSilverTo( Mobile mob )
|
||||
{
|
||||
if ( m_SilverGiven == null )
|
||||
m_SilverGiven = new SilverGivenCollection();
|
||||
m_SilverGiven = new List<SilverGivenEntry>();
|
||||
|
||||
m_SilverGiven.Add( new SilverGivenEntry( mob ) );
|
||||
}
|
||||
|
|
@ -69,7 +70,7 @@ namespace Server.Factions
|
|||
((PlayerMobile)m_Mobile).FactionPlayerState = this;
|
||||
}
|
||||
|
||||
public PlayerState( Mobile mob, Faction faction, PlayerStateCollection owner )
|
||||
public PlayerState( Mobile mob, Faction faction, List<PlayerState> owner )
|
||||
{
|
||||
m_Mobile = mob;
|
||||
m_Faction = faction;
|
||||
|
|
@ -81,7 +82,7 @@ namespace Server.Factions
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
public PlayerState( GenericReader reader, Faction faction, PlayerStateCollection owner )
|
||||
public PlayerState( GenericReader reader, Faction faction, List<PlayerState> owner )
|
||||
{
|
||||
m_Faction = faction;
|
||||
m_Owner = owner;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,17 @@ using System;
|
|||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class Reflector
|
||||
{
|
||||
private static ArrayList m_Types = new ArrayList();
|
||||
private static List<Type> m_Types = new List<Type>();
|
||||
|
||||
private static TownCollection m_Towns;
|
||||
private static List<Town> m_Towns;
|
||||
|
||||
public static TownCollection Towns
|
||||
public static List<Town> Towns
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -22,9 +23,9 @@ namespace Server.Factions
|
|||
}
|
||||
}
|
||||
|
||||
private static FactionCollection m_Factions;
|
||||
private static List<Faction> m_Factions;
|
||||
|
||||
public static FactionCollection Factions
|
||||
public static List<Faction> Factions
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -71,11 +72,11 @@ namespace Server.Factions
|
|||
else
|
||||
m_Types.Add( ScriptCompiler.FindTypeByFullName( typeName, false ) );
|
||||
|
||||
return (Type) m_Types[m_Types.Count - 1];
|
||||
return m_Types[m_Types.Count - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return (Type)m_Types[index - 1];
|
||||
return m_Types[index - 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,8 +88,8 @@ namespace Server.Factions
|
|||
|
||||
private static void ProcessTypes()
|
||||
{
|
||||
m_Factions = new FactionCollection();
|
||||
m_Towns = new TownCollection();
|
||||
m_Factions = new List<Faction>();
|
||||
m_Towns = new List<Town>();
|
||||
|
||||
Assembly[] asms = ScriptCompiler.Assemblies;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Server;
|
|||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
using Server.Commands;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
|
|
@ -74,7 +75,7 @@ namespace Server.Factions
|
|||
if ( reg.Map != Faction.Facet )
|
||||
return null;
|
||||
|
||||
TownCollection towns = Towns;
|
||||
List<Town> towns = Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
@ -91,7 +92,7 @@ namespace Server.Factions
|
|||
{
|
||||
get
|
||||
{
|
||||
VendorListCollection vendorLists = VendorLists;
|
||||
List<VendorList> vendorLists = VendorLists;
|
||||
int upkeep = 0;
|
||||
|
||||
for ( int i = 0; i < vendorLists.Count; ++i )
|
||||
|
|
@ -105,7 +106,7 @@ namespace Server.Factions
|
|||
{
|
||||
get
|
||||
{
|
||||
GuardListCollection guardLists = GuardLists;
|
||||
List<GuardList> guardLists = GuardLists;
|
||||
int upkeep = 0;
|
||||
|
||||
for ( int i = 0; i < guardLists.Count; ++i )
|
||||
|
|
@ -129,7 +130,7 @@ namespace Server.Factions
|
|||
{
|
||||
get
|
||||
{
|
||||
MonolithCollection monoliths = BaseMonolith.Monoliths;
|
||||
List<BaseMonolith> monoliths = BaseMonolith.Monoliths;
|
||||
|
||||
foreach ( BaseMonolith monolith in monoliths )
|
||||
{
|
||||
|
|
@ -258,12 +259,12 @@ namespace Server.Factions
|
|||
{
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
VendorListCollection vendorLists = VendorLists;
|
||||
List<VendorList> vendorLists = VendorLists;
|
||||
|
||||
for ( int i = 0; i < vendorLists.Count; ++i )
|
||||
list.AddRange( vendorLists[i].Vendors );
|
||||
|
||||
GuardListCollection guardLists = GuardLists;
|
||||
List<GuardList> guardLists = GuardLists;
|
||||
|
||||
for ( int i = 0; i < guardLists.Count; ++i )
|
||||
list.AddRange( guardLists[i].Guards );
|
||||
|
|
@ -271,16 +272,16 @@ namespace Server.Factions
|
|||
return list;
|
||||
}
|
||||
|
||||
private VendorListCollection m_VendorLists;
|
||||
private GuardListCollection m_GuardLists;
|
||||
private List<VendorList> m_VendorLists;
|
||||
private List<GuardList> m_GuardLists;
|
||||
|
||||
public VendorListCollection VendorLists
|
||||
public List<VendorList> VendorLists
|
||||
{
|
||||
get{ return m_VendorLists; }
|
||||
set{ m_VendorLists = value; }
|
||||
}
|
||||
|
||||
public GuardListCollection GuardLists
|
||||
public List<GuardList> GuardLists
|
||||
{
|
||||
get{ return m_GuardLists; }
|
||||
set{ m_GuardLists = value; }
|
||||
|
|
@ -290,7 +291,7 @@ namespace Server.Factions
|
|||
{
|
||||
GuardDefinition[] defs = ( Owner == null ? new GuardDefinition[0] : Owner.Definition.Guards );
|
||||
|
||||
m_GuardLists = new GuardListCollection();
|
||||
m_GuardLists = new List<GuardList>();
|
||||
|
||||
for ( int i = 0; i < defs.Length; ++i )
|
||||
m_GuardLists.Add( new GuardList( defs[i] ) );
|
||||
|
|
@ -298,7 +299,7 @@ namespace Server.Factions
|
|||
|
||||
public GuardList FindGuardList( Type type )
|
||||
{
|
||||
GuardListCollection guardLists = GuardLists;
|
||||
List<GuardList> guardLists = GuardLists;
|
||||
|
||||
for ( int i = 0; i < guardLists.Count; ++i )
|
||||
{
|
||||
|
|
@ -315,7 +316,7 @@ namespace Server.Factions
|
|||
{
|
||||
VendorDefinition[] defs = VendorDefinition.Definitions;
|
||||
|
||||
m_VendorLists = new VendorListCollection();
|
||||
m_VendorLists = new List<VendorList>();
|
||||
|
||||
for ( int i = 0; i < defs.Length; ++i )
|
||||
m_VendorLists.Add( new VendorList( defs[i] ) );
|
||||
|
|
@ -323,7 +324,7 @@ namespace Server.Factions
|
|||
|
||||
public VendorList FindVendorList( Type type )
|
||||
{
|
||||
VendorListCollection vendorLists = VendorLists;
|
||||
List<VendorList> vendorLists = VendorLists;
|
||||
|
||||
for ( int i = 0; i < vendorLists.Count; ++i )
|
||||
{
|
||||
|
|
@ -400,7 +401,7 @@ namespace Server.Factions
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
TownCollection towns = Towns;
|
||||
List<Town> towns = Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
@ -435,7 +436,7 @@ namespace Server.Factions
|
|||
return ( mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance );
|
||||
}
|
||||
|
||||
public static TownCollection Towns{ get{ return Reflector.Towns; } }
|
||||
public static List<Town> Towns { get { return Reflector.Towns; } }
|
||||
|
||||
public const int SilverCaptureBonus = 10000;
|
||||
|
||||
|
|
@ -468,23 +469,23 @@ namespace Server.Factions
|
|||
if ( monolith != null )
|
||||
monolith.Faction = f;
|
||||
|
||||
VendorListCollection vendorLists = VendorLists;
|
||||
List<VendorList> vendorLists = VendorLists;
|
||||
|
||||
for ( int i = 0; i < vendorLists.Count; ++i )
|
||||
{
|
||||
VendorList vendorList = vendorLists[i];
|
||||
FactionVendorCollection vendors = vendorList.Vendors;
|
||||
List<BaseFactionVendor> vendors = vendorList.Vendors;
|
||||
|
||||
for ( int j = vendors.Count - 1; j >= 0; --j )
|
||||
vendors[j].Delete();
|
||||
}
|
||||
|
||||
GuardListCollection guardLists = GuardLists;
|
||||
List<GuardList> guardLists = GuardLists;
|
||||
|
||||
for ( int i = 0; i < guardLists.Count; ++i )
|
||||
{
|
||||
GuardList guardList = guardLists[i];
|
||||
FactionGuardCollection guards = guardList.Guards;
|
||||
List<BaseFactionGuard> guards = guardList.Guards;
|
||||
|
||||
for ( int j = guards.Count - 1; j >= 0; --j )
|
||||
guards[j].Delete();
|
||||
|
|
@ -522,7 +523,7 @@ namespace Server.Factions
|
|||
|
||||
public static Town Parse( string name )
|
||||
{
|
||||
TownCollection towns = Towns;
|
||||
List<Town> towns = Towns;
|
||||
|
||||
for ( int i = 0; i < towns.Count; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class VendorList
|
||||
{
|
||||
private VendorDefinition m_Definition;
|
||||
private FactionVendorCollection m_Vendors;
|
||||
private List<BaseFactionVendor> m_Vendors;
|
||||
|
||||
public VendorDefinition Definition{ get{ return m_Definition; } }
|
||||
public FactionVendorCollection Vendors{ get{ return m_Vendors; } }
|
||||
public List<BaseFactionVendor> Vendors { get { return m_Vendors; } }
|
||||
|
||||
public BaseFactionVendor Construct( Town town, Faction faction )
|
||||
{
|
||||
|
|
@ -20,7 +21,7 @@ namespace Server.Factions
|
|||
public VendorList( VendorDefinition definition )
|
||||
{
|
||||
m_Definition = definition;
|
||||
m_Vendors = new FactionVendorCollection();
|
||||
m_Vendors = new List<BaseFactionVendor>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue