本文整理汇总了C#中Map类的典型用法代码示例。如果您正苦于以下问题:C# Map类的具体用法?C# Map怎么用?C# Map使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Map类属于命名空间,在下文中一共展示了Map类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
}
开发者ID:nathanvy,项目名称:runuo,代码行数:26,代码来源:RecallRune.cs
示例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;
}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:32,代码来源:MessageInABottle.cs
示例3: LocationStruct
public LocationStruct(GenericReader reader)
{
int version = reader.ReadInt();
Map = reader.ReadMap();
Location = reader.ReadPoint3D();
Name = reader.ReadString();
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:SunnyToolbar.cs
示例4: GetMapHue
public int GetMapHue( Map map )
{
if ( map == Map.Felucca )
return 81;
return 0;
}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:7,代码来源:RunebookGump.cs
示例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();
}
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:35,代码来源:GateTravel.cs
示例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;
}
开发者ID:DmitryKrohmal,项目名称:Mind-mapping,代码行数:7,代码来源:TopicWorker.cs
示例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;
}
开发者ID:WGDEVS,项目名称:SeaBattle,代码行数:18,代码来源:AdvancedTurn.cs
示例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;
}
开发者ID:Im2ortal,项目名称:mooege,代码行数:8,代码来源:151087.cs
示例9: MoleHideInfo
public MoleHideInfo( Point3D loc, Map map, Mobile user )
{
m_Location = loc;
m_Map = map;
m_User = user;
m_Count = 9;
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:MoleHide.cs
示例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,
});
}
开发者ID:n4v,项目名称:mooege,代码行数:30,代码来源:GargantuanMinion.cs
示例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);
}
开发者ID:liszto,项目名称:UnitySlippyMap,代码行数:31,代码来源:TestMap.cs
示例12: Form1
public Form1()
{
_map = new MapAround.Mapping.Map();
InitializeComponent();
mapControl.Map = _map;
}
开发者ID:gkrsu,项目名称:maparound.example,代码行数:7,代码来源:Form1.cs
示例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);
}
开发者ID:pchote,项目名称:OpenRA,代码行数:25,代码来源:UpgradeMapCommand.cs
示例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);
}
开发者ID:crast,项目名称:GameJam,代码行数:7,代码来源:BreakableBlock.cs
示例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();
}
}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:30,代码来源:PlayerMobileExt.cs
示例16: Proc
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args)
{
byte level;
ActorPC pc = (ActorPC)sActor;
ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
Tasks.PassiveSkillStatus ss;
level = (byte)(args.skillID - baseID + 1);
switch (SkillHandler.AddPassiveStatus(pc, "MentalPower", 3, out ss, new PassiveSkillStatus.DeactivateFunc(Deactivate)))
{
case PassiveStatusAddResult.WeaponMissMatch:
if (ss != null)
{
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
}
break;
case PassiveStatusAddResult.Updated:
BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true);
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
ss.level = level;
break;
case PassiveStatusAddResult.OK:
ss.level = level;
BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false);
break;
}
}
开发者ID:Willyham,项目名称:SagaRO2,代码行数:26,代码来源:MentalPower.cs
示例17: LoadHeaderInternal
static Map LoadHeaderInternal( [NotNull] Stream stream ) {
if( stream == null ) throw new ArgumentNullException( "stream" );
BinaryReader bs = new BinaryReader( stream );
// Read in the magic number
if( bs.ReadByte() != 0xbe || bs.ReadByte() != 0xee || bs.ReadByte() != 0xef ) {
throw new MapFormatException( "MinerCPP map header is incorrect." );
}
// Read in the map dimesions
// Saved in big endian for who-know-what reason.
// XYZ(?)
int width = IPAddress.NetworkToHostOrder( bs.ReadInt16() );
int height = IPAddress.NetworkToHostOrder( bs.ReadInt16() );
int length = IPAddress.NetworkToHostOrder( bs.ReadInt16() );
// ReSharper disable UseObjectOrCollectionInitializer
Map map = new Map( null, width, length, height, false );
// ReSharper restore UseObjectOrCollectionInitializer
// Read in the spawn location
// XYZ(?)
map.Spawn = new Position {
X = IPAddress.NetworkToHostOrder( bs.ReadInt16() ),
Z = IPAddress.NetworkToHostOrder( bs.ReadInt16() ),
Y = IPAddress.NetworkToHostOrder( bs.ReadInt16() ),
R = bs.ReadByte(),
L = bs.ReadByte()
};
// Skip over the block count, totally useless
bs.ReadInt32();
return map;
}
开发者ID:fragmer,项目名称:fCraft,代码行数:35,代码来源:MapMinerCPP.cs
示例18: FeatureLayerHelper
public FeatureLayerHelper(Map map, string name, FeatureLayer.QueryMode mode, bool visible)
{
this.FeatureLayer = (FeatureLayer)map.Layers.FirstOrDefault(layer => (layer is FeatureLayer) && ((FeatureLayer)layer).DisplayName.ToLower().Equals(name.ToLower()));
if (this.FeatureLayer == null)
{
Log.Trace("Could not find layer with name '" + name + "'");
return;
}
this.FeatureLayer.Visible = visible;
this.FeatureLayer.Mode = mode;
this.FeatureLayer.AutoSave = false;
this.Fields = QueryLayerFields(this.FeatureLayer);
if (this.Fields == null)
Log.Trace("Could not query layer fields '" + name + "'");
this.FeatureLayer.Initialized += FeatureLayer_Initialized;
this.FeatureLayer.Initialize();
this.FeatureLayer.BeginSaveEdits += FeatureLayer_BeginSaveEdits;
this.FeatureLayer.EndSaveEdits += FeatureLayer_EndSaveEdits;
this.FeatureLayer.UpdateCompleted += FeatureLayer_UpdateCompleted;
this.FeatureLayer.UpdateFailed += FeatureLayer_UpdateFailed;
this.FeatureLayer.SaveEditsFailed += FeatureLayer_SaveEditsFailed;
}
开发者ID:RockDr,项目名称:route-monitor-for-geoevent,代码行数:26,代码来源:FeatureLayerHelper.cs
示例19: EnsureDefaults
public override void EnsureDefaults()
{
base.EnsureDefaults();
Location = DefLocation;
Map = DefMap;
}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:7,代码来源:LocationConquest.cs
示例20: AddPoint
private void AddPoint(Map controlMap, GeoCoordinate geo)
{
// With the new Map control:
// Map -> MapLayer -> MapOverlay -> UIElements
// - Add a MapLayer to the Map
// - Add an MapOverlay to that layer
// - We can add a single UIElement to that MapOverlay.Content
MapLayer ml = new MapLayer();
MapOverlay mo = new MapOverlay();
// Add an Ellipse UI
Ellipse r = new Ellipse();
r.Fill = new SolidColorBrush(Color.FromArgb(255, 240, 5, 5));
// the item is placed on the map at the top left corner so
// in order to center it, we change the margin to a negative
// margin equal to half the width and height
r.Width = r.Height = 12;
r.Margin = new Thickness(-6, -6, 0, 0);
// Add the Ellipse to the Content
mo.Content = r;
// Set the GeoCoordinate of that content
mo.GeoCoordinate = geo;
// Add the MapOverlay to the MapLayer
ml.Add(mo);
// Add the MapLayer to the Map
controlMap.Layers.Add(ml);
}
开发者ID:natsirt20,项目名称:School,代码行数:28,代码来源:Geolocation.xaml.cs
注:本文中的Map类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论