本文整理汇总了C#中GenericReader.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadByte方法的具体用法?C# GenericReader.ReadByte怎么用?C# GenericReader.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadByte();
if ( version == 0 )
{
Timer.DelayCall( TimeSpan.Zero, delegate()
{
for ( int i = 0; i < Components.Count; ++i )
{
AddonComponent ac = Components[i] as AddonComponent;
if ( ac != null && ac.Hue == 2118 )
ac.Hue = 1161;
}
} );
}
if ( version <= 1 )
{
Timer.DelayCall( TimeSpan.Zero, delegate()
{
for ( int i = 0; i < Components.Count; ++i )
{
AddonComponent ac = Components[i] as AddonComponent;
if ( ac != null )
ac.Name = "jack-o-lantern";
}
} );
}
}
示例2: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadByte();
if (this.ItemID == 4678 || this.ItemID == 4679)
this.ItemID = 4656;
else if (this.ItemID == 4712 || this.ItemID == 4713)
this.ItemID = 4702;
}
示例3: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
this.m_Code = reader.ReadByte();
this.m_Controller = reader.ReadItem() as PrimevalLichPuzzle;
// remove if no controller exists or is deleted
if (null == this.m_Controller || this.m_Controller.Deleted)
this.Delete();
}
示例4: VirtueInfo
public VirtueInfo(GenericReader reader)
{
int version = reader.ReadByte();
switch (version)
{
case 1: //Changed the values throughout the virtue system
case 0:
{
int mask = reader.ReadByte();
if (mask != 0)
{
m_Values = new int[8];
for (int i = 0; i < 8; ++i)
{
if ((mask & (1 << i)) != 0)
{
m_Values[i] = reader.ReadInt();
}
}
}
break;
}
}
if (version == 0)
{
Compassion *= 200;
Sacrifice *= 250; //Even though 40 (the max) only gives 10k, It's because it was formerly too easy
//No direct conversion factor for Justice, this is just an approximation
Justice *= 500;
//All the other virtues haven't been defined at 'version 0' point in time in the scripts.
}
}
示例5: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadByte();
switch ( version )
{
case 0:
{
m_LabelNumber = reader.ReadEncodedInt();
break;
}
}
}
示例6: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 0:
//_PoisonChancePenaltyPerFollower = reader.ReadDouble();
_ItemsBlockPlacement = (HousePlacementItemBlocking)reader.ReadByte();
_MobsBlockPlacement = reader.ReadBool();
_PetsBlockPlacement = reader.ReadBool();
_MinPlaceDelay = reader.ReadInt();
_MaxPlaceDelay = reader.ReadInt();
break;
}
m_Instance = this;
}
示例7: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 2:
{
m_EventType = (EventType)reader.ReadByte();
goto case 1;
}
case 1:
{
m_TargetLocation = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
break;
}
}
}
示例8: FactionItem
public FactionItem( GenericReader reader, Faction faction )
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
m_OrigLootType = (LootType)reader.ReadByte();
m_OrigHue = reader.ReadInt();
goto case 0;
}
case 0:
{
m_Item = reader.ReadItem();
m_Expiration = reader.ReadDateTime();
break;
}
}
m_Faction = faction;
}
示例9: Object
public static object Object(GenericReader reader)
{
if (reader == null)
return null;
byte type = reader.ReadByte();
switch ( type )
{
case 0x0:
return null; // invalid
case 0x1:
return reader.ReadInt();
case 0x2:
return reader.ReadString();
case 0x3:
return reader.ReadItem();
case 0x4:
return reader.ReadMobile();
}
return null;
}
示例10: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadByte();
}
示例11: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
_AnybodyAllowedInStronghold = reader.ReadBool();
goto case 0;
case 0:
//_PoisonChancePenaltyPerFollower = reader.ReadDouble();
_CriminalCanUseOthersGates = reader.ReadBool();
_SigilAnnounceStolen = (SigilStolenAnnouncing)reader.ReadByte();
_SigilCorruptionGrace = reader.ReadTimeSpan();
_SigilCorruptionPeriod = reader.ReadTimeSpan();
_SigilReturnPeriod = reader.ReadTimeSpan();
_SigilPurificationPeriod = reader.ReadTimeSpan();
break;
}
m_Instance = this;
}
示例12: RunebookEntry
public RunebookEntry( GenericReader reader )
{
int version = reader.ReadByte();
switch ( version )
{
case 1:
case 0:
{
m_Location = reader.ReadPoint3D();
m_Map = reader.ReadMap();
m_Description = reader.ReadString();
break;
}
}
}
示例13: Deserialize
public override void Deserialize( GenericReader gr )
{
base.Deserialize( gr );
int version = gr.ReadInt();
if ( version > 6 )
{
int nreput = gr.ReadInt();
for(int t = 0;t < nreput;t++ )
{
int krep = gr.ReadInt();
int vrep = gr.ReadInt();
reputationAdjustments[ krep ] = vrep;
}
}
if ( version > 5 )
{
int nact = gr.ReadInt();
for(int t = 0;t < nact;t++ )
actionBar.Add( new Action( gr ) );
}
if ( version > 4 )
{
int nf = gr.ReadInt();
for(int t = 0;t < nf;t++ )
{
UInt64 gu = (UInt64)gr.ReadInt64();
friends.Add( gu );
string user = gr.ReadString();
friends.Add( user );
}
}
if ( version > 2 )
{
BindingPointX = gr.ReadFloat();
BindingPointY = gr.ReadFloat();
BindingPointZ = gr.ReadFloat();
BindingPointMapId = (UInt16)gr.ReadInt();
}
if ( version > 1 )
{
bool pa = gr.ReadBool();
if ( pa )
{
petActions = new int[ 11 ];
for(int t = 0;t < 11;t++ )
petActions[ t ] = gr.ReadInt();
}
}
int sum = gr.ReadInt();
if ( sum != 0 )
{
UInt64 g = gr.ReadInt64();
if ( version > 7 )
{
int sid = gr.ReadInt();
Summon = new BaseCreature( gr );
Summon.Id = sid;
}
// Summon = (Mobile)MobileList.TempSummon[ g ];
Summon.SummonedBy = this;
( Summon as BaseCreature ).AIEngine = new SummonedAI( this, Summon as BaseCreature );
}
sum = gr.ReadInt();
if ( sum != 0 )
{
Charm = (Mobile)MobileList.TempSummon[ gr.ReadInt64() ];
Charm.CharmedBy = this;
( Charm as BaseCreature ).AIEngine = new SummonedAI( this, Charm as BaseCreature );
}
CorpseLocationX = gr.ReadFloat();
CorpseLocationY = gr.ReadFloat();
CorpseLocationZ = gr.ReadFloat();
if ( version > 3 )
CorpseMapId = (ushort)gr.ReadShort();
corpsGuid = gr.ReadInt64();
zones = new uint[ 32 ];
for(int t = 0;t < 32;t++ )
zones[ t ] = (uint)gr.ReadInt();
int exi = gr.ReadInt();
if ( exi == 1 )
{
mark = new Position( gr.ReadFloat(), gr.ReadFloat(), gr.ReadFloat(), gr.ReadInt() );
}
ammoType = gr.ReadInt();
race = (Races)gr.ReadByte();
if ( version == 0 )
Classe = (Classes)gr.ReadByte();
gender = gr.ReadByte();
skin = gr.ReadByte();
face = gr.ReadByte();
hairStyle = gr.ReadByte();
hairColour = gr.ReadByte();
facialHair = gr.ReadByte();
copper = (uint)gr.ReadInt();
int nactq = 20;
for(int t = 0;t < nactq;t++ )
{
int vv = gr.ReadInt();
if ( vv == 1 )
//.........这里部分代码省略.........
示例14: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 4:
{
this.m_SecureLevel = (SecureLevel)reader.ReadInt();
goto case 3;
}
case 3:
case 2:
{
BookContent content = this.DefaultContent;
SaveFlags flags = (SaveFlags)reader.ReadByte();
if ((flags & SaveFlags.Title) != 0)
this.m_Title = Utility.Intern(reader.ReadString());
else if (content != null)
this.m_Title = content.Title;
if ((flags & SaveFlags.Author) != 0)
this.m_Author = reader.ReadString();
else if (content != null)
this.m_Author = content.Author;
this.m_Writable = (flags & SaveFlags.Writable) != 0;
if ((flags & SaveFlags.Content) != 0)
{
this.m_Pages = new BookPageInfo[reader.ReadEncodedInt()];
for (int i = 0; i < this.m_Pages.Length; ++i)
this.m_Pages[i] = new BookPageInfo(reader);
}
else
{
if (content != null)
this.m_Pages = content.Copy();
else
this.m_Pages = new BookPageInfo[0];
}
break;
}
case 1:
case 0:
{
this.m_Title = reader.ReadString();
this.m_Author = reader.ReadString();
this.m_Writable = reader.ReadBool();
if (version == 0 || reader.ReadBool())
{
this.m_Pages = new BookPageInfo[reader.ReadInt()];
for (int i = 0; i < this.m_Pages.Length; ++i)
this.m_Pages[i] = new BookPageInfo(reader);
}
else
{
BookContent content = this.DefaultContent;
if (content != null)
this.m_Pages = content.Copy();
else
this.m_Pages = new BookPageInfo[0];
}
break;
}
}
if (version < 3 && (this.Weight == 1 || this.Weight == 2))
this.Weight = -1;
}
示例15: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 5:
{
m_Quality = (BookQuality)reader.ReadByte();
goto case 4;
}
case 4:
{
m_EngravedText = reader.ReadString();
goto case 3;
}
case 3:
{
m_Crafter = reader.ReadMobile();
goto case 2;
}
case 2:
{
m_Slayer = (SlayerName)reader.ReadInt();
m_Slayer2 = (SlayerName)reader.ReadInt();
goto case 1;
}
case 1:
{
m_AosAttributes = new AosAttributes(this, reader);
m_AosSkillBonuses = new AosSkillBonuses(this, reader);
goto case 0;
}
case 0:
{
m_Content = reader.ReadULong();
m_Count = reader.ReadInt();
break;
}
}
if (m_AosAttributes == null)
{
m_AosAttributes = new AosAttributes(this);
}
if (m_AosSkillBonuses == null)
{
m_AosSkillBonuses = new AosSkillBonuses(this);
}
if (Core.AOS && Parent is Mobile)
{
m_AosSkillBonuses.AddTo((Mobile)Parent);
}
int strBonus = m_AosAttributes.BonusStr;
int dexBonus = m_AosAttributes.BonusDex;
int intBonus = m_AosAttributes.BonusInt;
if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
{
Mobile m = (Mobile)Parent;
string modName = Serial.ToString();
if (strBonus != 0)
{
m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
}
if (dexBonus != 0)
{
m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
}
if (intBonus != 0)
{
m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
}
}
if (Parent is Mobile)
{
((Mobile)Parent).CheckStatTimers();
}
}