本文整理汇总了C#中GenericReader.ReadEncodedInt方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadEncodedInt方法的具体用法?C# GenericReader.ReadEncodedInt怎么用?C# GenericReader.ReadEncodedInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadEncodedInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BOBSmallEntry
public BOBSmallEntry( GenericReader reader )
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 0:
{
string type = reader.ReadString();
if ( type != null )
m_ItemType = ScriptCompiler.FindTypeByFullName( type );
m_RequireExceptional = reader.ReadBool();
m_DeedType = (BODType)reader.ReadEncodedInt();
m_Material = (BulkMaterialType)reader.ReadEncodedInt();
m_AmountCur = reader.ReadEncodedInt();
m_AmountMax = reader.ReadEncodedInt();
m_Number = reader.ReadEncodedInt();
m_Graphic = reader.ReadEncodedInt();
m_Price = reader.ReadEncodedInt();
break;
}
}
}
示例2: VendorInventory
public VendorInventory(BaseHouse house, GenericReader reader)
{
this.m_House = house;
int version = reader.ReadEncodedInt();
this.m_Owner = reader.ReadMobile();
this.m_VendorName = reader.ReadString();
this.m_ShopName = reader.ReadString();
this.m_Items = reader.ReadStrongItemList();
this.m_Gold = reader.ReadInt();
this.m_ExpireTime = reader.ReadDeltaTime();
if (this.m_Items.Count == 0 && this.m_Gold == 0)
{
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
}
else
{
TimeSpan delay = this.m_ExpireTime - DateTime.Now;
this.m_ExpireTimer = new ExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero);
this.m_ExpireTimer.Start();
}
}
示例3: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
PersistedType type;
while ( (type = (PersistedType)reader.ReadEncodedInt()) != PersistedType.Terminator )
{
switch ( type )
{
case PersistedType.Faction: new FactionState( reader ); break;
case PersistedType.Town: new TownState( reader ); break;
}
}
break;
}
}
}
示例4: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
m_Music = (MusicName) reader.ReadInt();
break;
}
}
if ( version == 0 ) // Music wasn't serialized in version 0, pick a new track of random rarity
{
DawnsMusicRarity rarity;
double rand = Utility.RandomDouble();
if ( rand < 0.025 )
rarity = DawnsMusicRarity.Rare;
else if ( rand < 0.225 )
rarity = DawnsMusicRarity.Uncommon;
else
rarity = DawnsMusicRarity.Common;
m_Music = DawnsMusicBox.RandomTrack( rarity );
}
}
示例5: Preferences
public Preferences(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 0:
{
int count = reader.ReadEncodedInt();
this.m_Table = new Hashtable(count);
this.m_Entries = new ArrayList(count);
for (int i = 0; i < count; ++i)
{
PreferencesEntry entry = new PreferencesEntry(reader, this, version);
if (entry.Mobile != null)
{
this.m_Table[entry.Mobile] = entry;
this.m_Entries.Add(entry);
}
}
break;
}
}
}
示例6: Orders
public Orders( BaseFactionGuard guard, GenericReader reader )
{
m_Guard = guard;
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
m_Follow = reader.ReadMobile();
goto case 0;
}
case 0:
{
int count = reader.ReadEncodedInt();
m_Reactions = new ArrayList( count );
for ( int i = 0; i < count; ++i )
m_Reactions.Add( new Reaction( reader ) );
m_Movement = (MovementType)reader.ReadEncodedInt();
break;
}
}
}
示例7: ReadType
public static Type ReadType(Type[] referenceTable, GenericReader reader)
{
int encoding = reader.ReadEncodedInt();
switch ( encoding )
{
default:
case 0x00: // null
{
return null;
}
case 0x01: // indexed
{
int index = reader.ReadEncodedInt();
if (index >= 0 && index < referenceTable.Length)
return referenceTable[index];
return null;
}
case 0x02: // by name
{
string fullName = reader.ReadString();
if (fullName == null)
return null;
return ScriptCompiler.FindTypeByFullName(fullName, false);
}
}
}
示例8: Election
public Election(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 0:
{
this.m_Faction = Faction.ReadReference(reader);
this.m_LastStateTime = reader.ReadDateTime();
this.m_State = (ElectionState)reader.ReadEncodedInt();
this.m_Candidates = new List<Candidate>();
int count = reader.ReadEncodedInt();
for (int i = 0; i < count; ++i)
{
Candidate cd = new Candidate(reader);
if (cd.Mobile != null)
this.m_Candidates.Add(cd);
}
break;
}
}
this.StartTimer();
}
示例9: PlayerState
public PlayerState(GenericReader reader, Faction faction, List<PlayerState> owner)
{
this.m_Faction = faction;
this.m_Owner = owner;
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
this.m_IsActive = reader.ReadBool();
this.m_LastHonorTime = reader.ReadDateTime();
goto case 0;
}
case 0:
{
this.m_Mobile = reader.ReadMobile();
this.m_KillPoints = reader.ReadEncodedInt();
this.m_MerchantTitle = (MerchantTitle)reader.ReadEncodedInt();
this.m_Leaving = reader.ReadDateTime();
break;
}
}
this.Attach();
}
示例10: BOBLargeEntry
public BOBLargeEntry( GenericReader reader )
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 0:
{
m_RequireExceptional = reader.ReadBool();
m_DeedType = (BODType)reader.ReadEncodedInt();
m_Material = (BulkMaterialType)reader.ReadEncodedInt();
m_AmountMax = reader.ReadEncodedInt();
m_Price = reader.ReadEncodedInt();
m_Entries = new BOBLargeSubEntry[reader.ReadEncodedInt()];
for ( int i = 0; i < m_Entries.Length; ++i )
m_Entries[i] = new BOBLargeSubEntry( reader );
break;
}
}
}
示例11: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
m_Level = (SecureLevel) reader.ReadEncodedInt();
}
示例12: PowerScrollFilter
public PowerScrollFilter(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch (version)
{
case 1:
m_SkillCat = (SkillCategory)reader.ReadEncodedInt();
m_SkillValue = reader.ReadEncodedInt();
break;
}
}
示例13: PowerScrollBookEntry
public PowerScrollBookEntry(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch (version)
{
case 0:
m_Skill = (SkillName)reader.ReadEncodedInt();
m_SkillValue = reader.ReadEncodedInt();
m_Price = reader.ReadEncodedInt();
break;
}
}
示例14: Reaction
public Reaction( GenericReader reader )
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 0:
{
m_Faction = Faction.ReadReference( reader );
m_Type = (ReactionType) reader.ReadEncodedInt();
break;
}
}
}
示例15: TalismanAttribute
public TalismanAttribute(GenericReader reader)
{
int version = reader.ReadInt();
SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
if (GetSaveFlag(flags, SaveFlag.Type))
this.m_Type = ScriptCompiler.FindTypeByFullName(reader.ReadString(), false);
if (GetSaveFlag(flags, SaveFlag.Name))
this.m_Name = TextDefinition.Deserialize(reader);
if (GetSaveFlag(flags, SaveFlag.Amount))
this.m_Amount = reader.ReadEncodedInt();
}