本文整理汇总了C#中GenericReader.ReadRect2D方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadRect2D方法的具体用法?C# GenericReader.ReadRect2D怎么用?C# GenericReader.ReadRect2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadRect2D方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CrateRectangle
public CrateRectangle(GenericReader reader)
{
int version = reader.ReadInt();
Rectangle = reader.ReadRect2D();
FirstDirection = (Direction)reader.ReadInt();
SecondDirection = (Direction)reader.ReadInt();
}
示例2: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if( version >= 1 )
{
m_Owner = reader.ReadMobile();
m_Tent = reader.ReadItem() as TentAddon;
m_Bedroll = reader.ReadItem() as TentBedroll;
m_Chest = reader.ReadItem() as SecureTentChest;
m_Bounds = reader.ReadRect2D();
if( m_Owner != null && m_Chest != null && m_Tent != null )
m_Region = new TravelTentRegion( m_Owner, m_Chest, m_Tent.Map, m_Bounds, 16 );
}
}
示例3: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 2:
{
m_GameItems = reader.ReadStrongItemList();
m_WinnerLocation = reader.ReadPoint3D();
goto case 1;
}
case 1:
{
m_GameArea = reader.ReadRect2D();
break;
}
}
}
示例4: ReadRect2DArray
public static List<Rectangle2D> ReadRect2DArray(GenericReader reader)
{
int size = reader.ReadInt();
List<Rectangle2D> newAry = new List<Rectangle2D>();
for (int i = 0; i < size; i++)
{
newAry.Add(reader.ReadRect2D());
}
return newAry;
}
示例5: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
this.m_Bounds = reader.ReadRect2D();
this.m_Width = reader.ReadInt();
this.m_Height = reader.ReadInt();
this.m_Protected = reader.ReadBool();
int count = reader.ReadInt();
for (int i = 0; i < count; i++)
this.m_Pins.Add(reader.ReadPoint2D());
break;
}
}
}
示例6: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
this.m_DamageEntries = new Dictionary<Mobile, int>();
int version = reader.ReadInt();
switch( version )
{
case 6:
SpawnName = reader.ReadString();
AutoRestart = reader.ReadBool();
SpawnMod = reader.ReadDouble();
SpawnRadius = reader.ReadInt();
goto case 5;
case 5:
{
int entries = reader.ReadInt();
Mobile m;
int damage;
for (int i = 0; i < entries; ++i)
{
m = reader.ReadMobile();
damage = reader.ReadInt();
if (m == null)
continue;
this.m_DamageEntries.Add(m, damage);
}
goto case 4;
}
case 4:
{
this.m_ConfinedRoaming = reader.ReadBool();
this.m_Idol = reader.ReadItem<IdolOfTheChampion>();
this.m_HasBeenAdvanced = reader.ReadBool();
goto case 3;
}
case 3:
{
this.m_SpawnArea = reader.ReadRect2D();
goto case 2;
}
case 2:
{
this.m_RandomizeType = reader.ReadBool();
goto case 1;
}
case 1:
{
if (version < 3)
{
int oldRange = reader.ReadInt();
this.m_SpawnArea = new Rectangle2D(new Point2D(this.X - oldRange, this.Y - oldRange), new Point2D(this.X + oldRange, this.Y + oldRange));
}
this.m_Kills = reader.ReadInt();
goto case 0;
}
case 0:
{
if (version < 1)
this.m_SpawnArea = new Rectangle2D(new Point2D(this.X - 24, this.Y - 24), new Point2D(this.X + 24, this.Y + 24)); //Default was 24
bool active = reader.ReadBool();
this.m_Type = (ChampionSpawnType)reader.ReadInt();
this.m_Creatures = reader.ReadStrongMobileList();
this.m_RedSkulls = reader.ReadStrongItemList();
this.m_WhiteSkulls = reader.ReadStrongItemList();
this.m_Platform = reader.ReadItem<ChampionPlatform>();
this.m_Altar = reader.ReadItem<ChampionAltar>();
this.m_ExpireDelay = reader.ReadTimeSpan();
this.m_ExpireTime = reader.ReadDeltaTime();
this.m_Champion = reader.ReadMobile();
this.m_RestartDelay = reader.ReadTimeSpan();
if (reader.ReadBool())
{
this.m_RestartTime = reader.ReadDeltaTime();
this.BeginRestart(this.m_RestartTime - DateTime.UtcNow);
}
if (version < 4)
{
this.m_Idol = new IdolOfTheChampion(this);
this.m_Idol.MoveToWorld(new Point3D(this.X, this.Y, this.Z - 15), this.Map);
}
if (this.m_Platform == null || this.m_Altar == null || this.m_Idol == null)
this.Delete();
else if (active)
this.Start();
//.........这里部分代码省略.........
示例7: DaviesDeedEntry
public DaviesDeedEntry(GenericReader reader)
{
int version = reader.ReadByte();
m_type = reader.ReadInt();
m_Level = reader.ReadInt();
m_Decoder = reader.ReadMobile();
m_Map = reader.ReadMap();
m_Location2d = reader.ReadPoint2D();
m_Location3d = reader.ReadPoint3D();
m_Bounds = reader.ReadRect2D();
m_Mapnumber = reader.ReadString();
}
示例8: DeserializeObject
public object DeserializeObject(GenericReader reader)
{
object output = null;
XmlObjectType xmlObjectType = (XmlObjectType)reader.ReadInt();
if (xmlObjectType == XmlObjectType.Mobile)
{
output = reader.ReadMobile();
}
else if (xmlObjectType == XmlObjectType.Item)
{
output = reader.ReadItem();
}
else if (xmlObjectType == XmlObjectType.MobileList)
{
output = reader.ReadStrongMobileList();
}
else if (xmlObjectType == XmlObjectType.ItemList)
{
output = reader.ReadStrongItemList();
}
else if (xmlObjectType == XmlObjectType.ArrayList)
{
int elements = reader.ReadInt();
ArrayList list = new ArrayList(elements);
for (int i = 0; i < elements; i++)
{
list.Add(DeserializeObject(reader));
}
output = list;
}
else if (xmlObjectType == XmlObjectType.DateTime)
{
output = reader.ReadDateTime();
}
else if (xmlObjectType == XmlObjectType.DateTimeOffset)
{
output = reader.ReadDateTimeOffset();
}
else if (xmlObjectType == XmlObjectType.BaseGuild)
{
output = reader.ReadGuild();
}
else if (xmlObjectType == XmlObjectType.IPAddress)
{
output = reader.ReadIPAddress();
}
else if (xmlObjectType == XmlObjectType.Map)
{
output = reader.ReadMap();
}
else if (xmlObjectType == XmlObjectType.Point3D)
{
output = reader.ReadPoint3D();
}
else if (xmlObjectType == XmlObjectType.Point2D)
{
output = reader.ReadPoint2D();
}
else if (xmlObjectType == XmlObjectType.TimeSpan)
{
output = reader.ReadTimeSpan();
}
else if (xmlObjectType == XmlObjectType.Rectangle2D)
{
output = reader.ReadRect2D();
}
else if (xmlObjectType == XmlObjectType.Rectangle3D)
{
output = reader.ReadRect3D();
}
else if (xmlObjectType == XmlObjectType.Double)
{
output = reader.ReadDouble();
}
else if (xmlObjectType == XmlObjectType.Integer)
{
output = reader.ReadInt();
}
else if (xmlObjectType == XmlObjectType.Boolean)
{
output = reader.ReadBool();
}
else if (xmlObjectType == XmlObjectType.UInt64)
{
output = reader.ReadULong();
}
else if (xmlObjectType == XmlObjectType.String)
{
output = reader.ReadString();
}
else if (xmlObjectType == XmlObjectType.Type)
{
output = UberScriptFunctions.Methods.TYPE(null, reader.ReadString());
}
else if (xmlObjectType == XmlObjectType.Other)
{
LoggingCustom.Log(
"ERROR_Uberscript.txt",
DateTime.Now + ": xmlobject: " + Name + " attached to " + AttachedTo +
//.........这里部分代码省略.........
示例9: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
this.m_Active = reader.ReadBool();
this.m_Word = reader.ReadString();
this.m_Destination = reader.ReadRect2D();
}
示例10: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_RegionBounds = reader.ReadRect2D();
m_Traps = reader.ReadStrongItemList<BaseTrap>();
goto case 0;
}
case 0:
{
if ( version < 1 )
{
m_Traps = new List<BaseTrap>();
m_RegionBounds = new Rectangle2D( X - 40, Y - 40, 80, 80 );
}
m_Creatures = reader.ReadStrongMobileList();
m_TypeName = reader.ReadString();
m_Door = reader.ReadItem<BaseDoor>(); ;
m_Addon = reader.ReadItem<BaseAddon>(); ;
m_Sequence = reader.ReadItem<GauntletSpawner>();
State = (GauntletSpawnerState)reader.ReadInt();
break;
}
}
}
示例11: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
_mPlayerScores = new Dictionary<Mobile, double>();
var version = reader.ReadInt();
switch (version)
{
case 0:
{
var entries = reader.ReadInt();
for (var i = 0; i < entries; ++i)
{
var m = reader.ReadMobile();
var damage = reader.ReadDouble();
if (m != null)
_mPlayerScores.Add(m, damage);
}
_mNextActiveTime = reader.ReadDeltaTime();
_mArea = reader.ReadRect2D();
_mAlwaysGrey = reader.ReadBool();
_mNoCorpseCarving = reader.ReadBool();
var active = reader.ReadBool();
_mExpireDelay = reader.ReadTimeSpan();
_mExpireTime = reader.ReadDeltaTime();
_mRestartDelay = reader.ReadTimeSpan();
if (reader.ReadBool())
{
_mRestartTime = reader.ReadDeltaTime();
BeginRestart(_mRestartTime - DateTime.UtcNow);
}
if (active)
Start();
break;
}
}
Timer.DelayCall(TimeSpan.Zero, UpdateRegion);
}
示例12: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 3:
{
this.m_State = (HouseRaffleState)reader.ReadEncodedInt();
goto case 2;
}
case 2:
{
this.m_ExpireAction = (HouseRaffleExpireAction)reader.ReadEncodedInt();
goto case 1;
}
case 1:
{
this.m_Deed = reader.ReadItem<HouseRaffleDeed>();
goto case 0;
}
case 0:
{
bool oldActive = (version < 3) ? reader.ReadBool() : false;
this.m_Bounds = reader.ReadRect2D();
this.m_Facet = reader.ReadMap();
this.m_Winner = reader.ReadMobile();
this.m_TicketPrice = reader.ReadInt();
this.m_Started = reader.ReadDateTime();
this.m_Duration = reader.ReadTimeSpan();
int entryCount = reader.ReadInt();
this.m_Entries = new List<RaffleEntry>(entryCount);
for (int i = 0; i < entryCount; i++)
{
RaffleEntry entry = new RaffleEntry(reader, version);
if (entry.From == null)
continue; // Character was deleted
this.m_Entries.Add(entry);
}
this.InvalidateRegion();
m_AllStones.Add(this);
if (version < 3)
{
if (oldActive)
this.m_State = HouseRaffleState.Active;
else if (this.m_Winner != null)
this.m_State = HouseRaffleState.Completed;
else
this.m_State = HouseRaffleState.Inactive;
}
break;
}
}
}
示例13: Arena
public Arena(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch ( version )
{
case 7:
{
this.m_IsGuarded = reader.ReadBool();
goto case 6;
}
case 6:
{
this.m_Ladder = reader.ReadItem() as LadderController;
goto case 5;
}
case 5:
{
this.m_Tournament = reader.ReadItem() as TournamentController;
this.m_Announcer = reader.ReadMobile();
goto case 4;
}
case 4:
{
this.m_Name = reader.ReadString();
goto case 3;
}
case 3:
{
this.m_Zone = reader.ReadRect2D();
goto case 2;
}
case 2:
{
this.m_GateIn = reader.ReadPoint3D();
this.m_GateOut = reader.ReadPoint3D();
this.m_Teleporter = reader.ReadItem();
goto case 1;
}
case 1:
{
this.m_Players = reader.ReadStrongMobileList();
goto case 0;
}
case 0:
{
this.m_Facet = reader.ReadMap();
this.m_Bounds = reader.ReadRect2D();
this.m_Outside = reader.ReadPoint3D();
this.m_Wall = reader.ReadPoint3D();
if (version == 0)
{
reader.ReadBool();
this.m_Players = new List<Mobile>();
}
this.m_Active = reader.ReadBool();
this.m_Points = new ArenaStartPoints(reader);
if (this.m_Active)
{
m_Arenas.Add(this);
m_Arenas.Sort();
}
break;
}
}
if (this.m_Zone.Start != Point2D.Zero && this.m_Zone.End != Point2D.Zero && this.m_Facet != null)
this.m_Region = new SafeZone(this.m_Zone, this.m_Outside, this.m_Facet, this.m_IsGuarded);
if (this.IsOccupied)
Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerCallback(Evict));
if (this.m_Tournament != null)
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(AttachToTournament_Sandbox));
}
示例14: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 6:
{
m_MobilesSeekHome = reader.ReadBool();
m_UsesSpawnerHome = reader.ReadBool();
goto case 5;
}
case 5:
{
m_SpawnArea = reader.ReadRect2D();
m_UsesSpawnerHome = reader.ReadBool();
goto case 4;
}
case 4:
{
m_WalkingRange = reader.ReadInt();
goto case 3;
}
case 3:
case 2:
{
m_WayPoint = reader.ReadItem() as WayPoint;
goto case 1;
}
case 1:
{
m_Group = reader.ReadBool();
goto case 0;
}
case 0:
{
m_MinDelay = reader.ReadTimeSpan();
m_MaxDelay = reader.ReadTimeSpan();
m_Count = reader.ReadInt();
m_Team = reader.ReadInt();
m_HomeRange = reader.ReadInt();
m_Running = reader.ReadBool();
TimeSpan ts = TimeSpan.Zero;
if (m_Running)
ts = reader.ReadDeltaTime() - DateTime.Now;
int size = reader.ReadInt();
m_SpawnNames = new List<string>(size);
for (int i = 0; i < size; ++i)
{
string creatureString = reader.ReadString();
m_SpawnNames.Add(creatureString);
string typeName = ParseType(creatureString);
if (ScriptCompiler.FindTypeByName(typeName) == null)
{
if (m_WarnTimer == null)
m_WarnTimer = new WarnTimer();
m_WarnTimer.Add(Location, Map, typeName);
}
}
int count = reader.ReadInt();
m_Spawned = new List<ISpawnable>(count);
for (int i = 0; i < count; ++i)
{
ISpawnable e = World.FindEntity(reader.ReadInt()) as ISpawnable;
if (e != null)
{
e.Spawner = this;
m_Spawned.Add(e);
}
}
if (m_Running)
{
RemoveSpawned();
m_Running = false;
}
break;
}
}
//.........这里部分代码省略.........
示例15: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
this.m_ChallengeArea = new Rectangle3D[0];
switch ( version )
{
case 2:
case 1:
{
this.m_Disable = reader.ReadBool();
goto case 0;
}
case 0:
{
this.m_Music = (MusicName)reader.ReadInt();
this.m_Priority = reader.ReadInt();
if (version < 2)
{
// old region area
reader.ReadRect2D();
}
this.m_ChallengeRegionName = reader.ReadString();
string mapname = reader.ReadString();
try
{
this.m_ChallengeMap = Map.Parse(mapname);
}
catch
{
}
this.m_CopiedRegion = reader.ReadString();
// do the coord list
int count = reader.ReadInt();
if (count > 0)
{
// the old version used 2D rectangles for the region area. The new version uses 3D
if (version < 2)
{
Rectangle2D[] area = new Rectangle2D[count];
for (int i = 0; i < count; i++)
{
area[i] = reader.ReadRect2D();
}
this.m_ChallengeArea = Region.ConvertTo3D(area);
}
else
{
this.m_ChallengeArea = new Rectangle3D[count];
for (int i = 0; i < count; i++)
{
this.m_ChallengeArea[i] = new Rectangle3D(reader.ReadPoint3D(), reader.ReadPoint3D());
}
}
}
break;
}
}
// refresh the region
Timer.DelayCall(TimeSpan.Zero, new TimerCallback(RefreshRegions));
}