本文整理汇总了C#中Map类的典型用法代码示例。如果您正苦于以下问题:C# Map类的具体用法?C# Map怎么用?C# Map使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Map类属于命名空间,在下文中一共展示了Map类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_House = reader.ReadItem() as BaseHouse;
goto case 0;
}
case 0:
{
m_Description = reader.ReadString();
m_Marked = reader.ReadBool();
m_Target = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
CalculateHue();
break;
}
}
}
示例2: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 3:
case 2:
{
m_Level = reader.ReadInt();
goto case 1;
}
case 1:
{
m_TargetMap = reader.ReadMap();
break;
}
case 0:
{
m_TargetMap = Map.Felucca;
break;
}
}
if ( version < 2 )
m_Level = GetRandomLevel();
// if( version < 3 && m_TargetMap == Map.Tokuno )
// m_TargetMap = Map.Felucca;
}
示例3: LocationStruct
public LocationStruct(GenericReader reader)
{
int version = reader.ReadInt();
Map = reader.ReadMap();
Location = reader.ReadPoint3D();
Name = reader.ReadString();
}
示例4: GetMapHue
public int GetMapHue( Map map )
{
if ( map == Map.Felucca )
return 81;
return 0;
}
示例5: Effect
public void Effect( Point3D loc, Map map, bool checkMulti )
{
if ( map == null || (!Core.AOS && Caster.Map != map) )
{
Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet.
}
else if ( !map.CanFit( loc.X, loc.Y, loc.Z, 16 ) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) )
{
Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
}
else if ( !SpellHelper.CheckTravel( Caster, loc, map, TravelType.Gate ) && Caster.AccessLevel == AccessLevel.Player )
{
Caster.PlaySound( 0x5C );
}
else if ( CheckSequence() )
{
Caster.SendLocalizedMessage( 501024 ); // You open a magical gate to another location
Effects.PlaySound( Caster.Location, Caster.Map, 0x20E );
InternalItem firstGate = new InternalItem( loc, map );
firstGate.MoveToWorld( Caster.Location, Caster.Map );
Effects.PlaySound( loc, map, 0x20E );
InternalItem secondGate = new InternalItem( Caster.Location, Caster.Map );
secondGate.MoveToWorld( loc, map );
}
FinishSequence();
}
示例6: TopicWorker
public TopicWorker(Factories.TopicFactory factory, Map map, Topic parentTopic, ITopicConnection connectionType)
{
_topic = factory.CreateTopic(map, parentTopic);
_topicPointer = factory.CreateTopicPointer(connectionType);
_topic.Pointer = _topicPointer;
}
示例7: turn
private bool UsingSelectedAttack; //Determines if an attack from a ship is being used for the turn (requires option 1)
#endregion Fields
#region Constructors
/// <summary>Initializes a member of the advanced turn class. Used to define maps used and how extra turns are awarded for the turn sequence.</summary>
/// <param name="Bonus">Determines if a turn is awarded for destroying a part of the opponent's ship.</param>
/// <param name="Salvo">Determines if a turn is awarded for each of the players ships above one.</param>
/// <param name="FriendlyMap">The player's map.</param
/// <param name="EnemyMap">The opponent's map</param>
public AdvancedTurn(bool Bonus, bool Salvo, Map FriendlyMap, Map EnemyMap)
: base(Bonus, Salvo, FriendlyMap, EnemyMap)
{
SelectedOption = 0;
SetSelectedIndex();
UsingSelectedAA = false;
}
示例8: OnKillListener
//This is the way we Listen for mob killing events.
private bool OnKillListener(Map.World world, string group)
{
while (world.HasActorsInGroup(group))
{
}
return true;
}
示例9: MoleHideInfo
public MoleHideInfo( Point3D loc, Map map, Mobile user )
{
m_Location = loc;
m_Map = map;
m_User = user;
m_Count = 9;
}
示例10: GargantuanMinion
public GargantuanMinion(Map.World world, PowerContext context, int GargID)
: base(world, 122305, context.User, null)
{
Scale = 1f;
//TODO: get a proper value for this.
this.WalkSpeed *= 5;
SetBrain(new MinionBrain(this));
(Brain as MinionBrain).AddPresetPower(30005);
(Brain as MinionBrain).AddPresetPower(30001);
(Brain as MinionBrain).AddPresetPower(30592);
(Brain as MinionBrain).AddPresetPower(30550);
Attributes[GameAttribute.Hitpoints_Max] = 5f;
Attributes[GameAttribute.Hitpoints_Cur] = 5f;
Attributes[GameAttribute.Attacks_Per_Second] = 1.0f;
Attributes[GameAttribute.Damage_Weapon_Min, 0] = 5f;
Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 7f;
Attributes[GameAttribute.Pet_Type] = 0x8;
//Pet_Owner and Pet_Creator seems to be 0
(context.User as Player).InGameClient.SendMessage(new PetMessage()
{
Field0 = 0,
Field1 = GargID,
PetId = this.DynamicID,
Field3 = 0x8,
});
}
示例11: Start
void Start()
{
// create the map singleton
map = Map.Instance;
// 9 rue Gentil, Lyon
map.CenterWGS84 = new double[2] { 4.83527, 45.76487 };
map.UseLocation = true;
map.InputsEnabled = true;
// create a test layer
TileLayer layer = map.CreateLayer<OSMTileLayer>("test tile layer");
layer.URLFormat = "http://a.tile.openstreetmap.org/{0}/{1}/{2}.png";
// create some test 2D markers
GameObject go = Tile.CreateTileTemplate();
go.renderer.material.mainTexture = MarkerTexture;
go.renderer.material.renderQueue = 4000;
GameObject markerGO;
markerGO = Instantiate(go) as GameObject;
map.CreateMarker<Marker>("test marker - 9 rue Gentil, Lyon", new double[2] { 4.83527, 45.76487 }, markerGO);
markerGO = Instantiate(go) as GameObject;
map.CreateMarker<Marker>("test marker - 31 rue de la Bourse, Lyon", new double[2] { 4.83699, 45.76535 }, markerGO);
markerGO = Instantiate(go) as GameObject;
map.CreateMarker<Marker>("test marker - 1 place St Nizier, Lyon", new double[2] { 4.83295, 45.76468 }, markerGO);
DestroyImmediate(go);
}
示例12: Form1
public Form1()
{
_map = new MapAround.Mapping.Map();
InitializeComponent();
mapControl.Map = _map;
}
示例13: ProcessYaml
static void ProcessYaml(ModData modData, Map map, MiniYaml yaml, int engineDate, UpgradeAction processYaml)
{
if (yaml == null)
return;
if (yaml.Value != null)
{
var files = FieldLoader.GetValue<string[]>("value", yaml.Value);
foreach (var filename in files)
{
var fileNodes = MiniYaml.FromStream(map.Open(filename), filename);
processYaml(modData, engineDate, ref fileNodes, null, 0);
// HACK: Obtain the writable save path using knowledge of the underlying filesystem workings
var packagePath = filename;
var package = map.Package;
if (filename.Contains("|"))
modData.DefaultFileSystem.TryGetPackageContaining(filename, out package, out packagePath);
((IReadWritePackage)package).Update(packagePath, Encoding.ASCII.GetBytes(fileNodes.WriteToString()));
}
}
processYaml(modData, engineDate, ref yaml.Nodes, null, 1);
}
示例14: BreakableBlock
public BreakableBlock(int x, int y, Sprite sprite, Map map)
: base(x,y, sprite)
{
//this.Kill(); // Do not draw me
this.collisionBlock = new CollisionBlock(x, y, sprite.Width, sprite.Height);
map.ExtraCollisionBlocks.Add(collisionBlock);
}
示例15: FixMap
public static void FixMap(this PlayerMobile m, Map def, Point3D loc)
{
if (m == null || m.Deleted || def == null || def == Map.Internal || loc == Point3D.Zero)
{
return;
}
if (m.LogoutMap == null || m.LogoutMap == Map.Internal)
{
m.LogoutLocation = loc.ToPoint3D();
m.LogoutMap = def;
}
if (m.Map != null)
{
return;
}
if (IsOnline(m))
{
m.MoveToWorld(loc, def);
BaseCreature.TeleportPets(m, loc, def);
}
else
{
m.Location = loc;
m.Internalize();
m.AutoStablePets();
}
}