本文整理汇总了C#中Zone类的典型用法代码示例。如果您正苦于以下问题:C# Zone类的具体用法?C# Zone怎么用?C# Zone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Zone类属于命名空间,在下文中一共展示了Zone类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Off
/// <summary>
/// Switch a specific zone of lights off
/// </summary>
/// <param name="zone">Zone to be switched off</param>
/// <returns>Byte command</returns>
public static byte[] Off(Zone zone)
{
byte value;
switch (zone)
{
case Zone.All:
value = 0x41;
break;
case Zone.One:
value = 0x46;
break;
case Zone.Two:
value = 0x48;
break;
case Zone.Three:
value = 0x4A;
break;
case Zone.Four:
value = 0x4C;
break;
default:
throw new ArgumentOutOfRangeException("zone");
}
return new byte[] { value, 0x00, 0x55 };
}
示例2: Reset
public void Reset()
{
Waypoints.Clear();
Zone = Zone.Unknown;
_position = 0;
_positions.Clear();
}
示例3: activate
public override void activate(ContentHandler content, Zone currentZone, string activationCode)
{
switch (activationCode)
{
case "STATIONARY":
stationary = true;
setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]);
break;
case "PUSH_UP":
stationary = false;
moveUp(currentZone);
setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]);
break;
case "PUSH_DOWN":
stationary = false;
moveDown(currentZone);
setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]);
break;
case "PUSH_RIGHT":
stationary = false;
moveRight(currentZone);
setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]);
break;
case "PUSH_LEFT":
stationary = false;
moveLeft(currentZone);
setNewAnimation(content.getObjectContentHandler().getObjectAnimations()[type][activationCode], content.getObjectContentHandler().getObjectAnimationOffsets()[type][activationCode]);
break;
default:
break;
}
}
示例4: BuildingSurfacesByGeometryGroups
public static Dictionary<string, object> BuildingSurfacesByGeometryGroups(List<List<Surface>> geometrySurfaces)
{
//var elements = new Elements();
var zones = new List<Zone>();
var buildingSurfaces = new List<BuildingSurface>();
var counter = 1;
foreach (var geometry in geometrySurfaces)
{
var bb = BoundingBox.ByGeometry(geometry);
var orientation = bb.ContextCoordinateSystem.XAxis.AngleBetween(Vector.ByCoordinates(1, 0, 0));
var zone = new Zone("Zone" + counter, orientation, bb.MinPoint);
counter++;
zones.Add(zone);
var p = bb.MinPoint.Add(bb.MaxPoint.AsVector());
var centerpoint = Point.ByCoordinates(p.X/2, p.Y/2, p.Z/2);
buildingSurfaces.AddRange(BuildingSurfacesByOrientation(geometry, zone, centerpoint));
}
//elements.AddZones(zones);
//elements.AddBuildingSurfaces(buildingSurfaces);
//return elements; // elements seems to be better, but for further editing zones and buildingsurfaces are retruned seperately...
return new Dictionary<string, object>
{
{ "Zones", zones },
{ "BuildingSurfaces", buildingSurfaces }
};
}
示例5: ZoneOrder
public ZoneOrder(Zone zone, bool isAllowed, Dictionary<PlayerIndex, Player> players)
{
this.isAllowed = isAllowed;
this.zone = zone;
this.players = players;
duration = 9;
}
示例6: Stylize
public string Stylize(Zone zone)
{
var fileStr = string.IsNullOrEmpty(zone.FileName) ? "" : string.Format(" in '{0}'", zone.FileName);
return string.Format(@"
<div id=""less-error-message"">
<h3>There is an error{0}</h3>
<p>{1} on line {3}, column {5}</p>
<div class=""extract"">
<pre class=""before""><span>{2}</span>{6}</pre>
<pre class=""line""><span>{3}</span>{7}<span class=""error"">{8}</span>{9}</pre>
<pre class=""after""><span>{4}</span>{10}</pre>
</div>
</div>
",
fileStr,
zone.Message,
zone.LineNumber - 1,
zone.LineNumber,
zone.LineNumber + 1,
zone.Position,
zone.Extract.Before,
zone.Extract.Line.Substring(0, zone.Position),
zone.Extract.Line[zone.Position],
zone.Extract.Line.Substring(zone.Position + 1),
zone.Extract.After);
}
示例7: Convert
public static DateTime Convert(Zone fromZone, Zone toZone, int year, int month, int day, int hour, int minute, int second, int millisecond)
{
TimeZoneInfo fromZoneInfo;
switch (fromZone)
{
case Zone.Utc:
fromZoneInfo = TimeZoneInfo.Utc;
break;
case Zone.System:
fromZoneInfo = TimeZoneInfo.Local;
break;
case Zone.Shoot:
fromZoneInfo = TimeZoneHandler.ShootTimeZone;
break;
default:
throw new ArgumentOutOfRangeException("fromZone");
}
TimeZoneInfo toZoneInfo;
switch (toZone)
{
case Zone.Utc:
toZoneInfo = TimeZoneInfo.Utc;
break;
case Zone.System:
toZoneInfo = TimeZoneInfo.Local;
break;
case Zone.Shoot:
toZoneInfo = TimeZoneHandler.ShootTimeZone;
break;
default:
throw new ArgumentOutOfRangeException("toZone");
}
return TimeZoneHandler.Convert(fromZoneInfo, toZoneInfo, year, month, day, hour, minute, second, millisecond);
}
示例8: TileEngine
public TileEngine(Map m)
{
this.m = m;
ee = new EntityEngine(new EntityEngineInterface(this));
camera = new TileEngineCamera(m.width,m.height);
foreach(Map.Entdef entdef in m.entdefs)
{
//todo
//Entity e = ee.SpawnMapEntity(entdef);
//mapEnts.add(e, entdef.descr, entdef.index);
}
foreach (Map.Zonedef zd in m.zonedefs)
{
Zone z = new Zone();
z.bAdjacent = (zd.method == 1);
z.chance = zd.percent / 255.0f;
z.name = zd.name;
z.script = zd.script;
zones.Add(z);
}
ee.EntityActivated += new EntityEngine.EntityActivationHandler(ee_EntityActivated);
ee.ZoneActivated += new EntityEngine.ZoneActivationHandler(ee_ZoneActivated);
}
示例9: ZoneNode
/// <summary>
/// The constructor of ZoneNode class
/// </summary>
/// <param name="zone"></param>
public ZoneNode(Zone zone)
: base(zone.Name)
{
m_zone = zone;
base.Text = m_zone.Name;
base.ToolTipText = "Phase: " + m_zone.Phase.Name;
}
示例10: Stylize
public string Stylize(Zone zone)
{
var template = @"
<div id=""less-error-message"">
<h3>There is an error in your .less file</h3>
<p>on line {1}, column {3}</p>
<div class=""extract"">
<pre class=""before""><span>{0}</span>{4}</pre>
<pre class=""line""><span>{1}</span>{5}<span class=""error"">{6}</span>{7}</pre>
<pre class=""after""><span>{2}</span>{8}</pre>
</div>
</div>
";
return string.Format(template,
zone.LineNumber - 1,
zone.LineNumber,
zone.LineNumber + 1,
zone.Position,
zone.Extract.Before, //
zone.Extract.Line.Substring(0, zone.Position), //
zone.Extract.Line[zone.Position], // Html Encode
zone.Extract.Line.Substring(zone.Position + 1), //
zone.Extract.After); //
}
示例11: Map
/// <summary>
/// Creates a Map object from file.
/// </summary>
/// <param name="File">The map file to create the object from.</param>
public Map(string filename)
{
using(FileStream stream = new FileStream(filename,FileMode.Open))
using(BinaryReader reader = new BinaryReader(stream))
{
short type;
_grid = new Zone[8, 8];
_version = reader.ReadInt32();
for(int zy = 0; zy < 8; zy++)
for(int zx = 0; zx < 8; zx++)
for(int y = 0; y < 32; y++)
for(int x = 0; x < 32; x++)
{
type = 0;
if(reader.ReadInt16() > 0) {
type &= 0x20;
}
type &= reader.ReadInt16();
_grid[zx, zy] = new Zone();
_grid[zx, zy][x, y] = (byte)type;
}
}
}
示例12: EjectPlayer
static void EjectPlayer(Zone zone, PlayerClient player)
{
cachedDirection = player.lastKnownPosition - zone.transform.position;
player.lastKnownPosition = zone.transform.position + (cachedDirection / cachedDirection.magnitude * (zone.GetComponent<UnityEngine.SphereCollider>().radius + 2f));
management.TeleportPlayerToWorld(player.netPlayer, player.lastKnownPosition);
Interface.CallHook("IsCollidingEject",zone, player);
}
示例13: GoToZoneAct
public GoToZoneAct(CreatureAI agent, Zone zone)
: base(agent)
{
Tree = null;
Name = "Goto zone : " + zone.ID;
Destination = zone;
}
示例14: PutItemWithTagTask
public PutItemWithTagTask(TagList tags, Zone zone)
{
Name = "Put Item with tag: " + tags + " in zone " + zone.ID;
Tags = tags;
Zone = zone;
Priority = PriorityType.Low;
}
示例15: Stylize
public string Stylize(Zone zone)
{
var fileStr = string.IsNullOrEmpty(zone.FileName) ? "" : string.Format(" in file '{0}'", zone.FileName);
var callStr = "";
if(zone.CallExtract != null)
{
callStr = string.Format(@"
from line {0}:
{0,5:[#]}: {1}",
zone.CallLine,
zone.CallExtract.Line);
}
return string.Format(@"
{1} on line {4}{0}:
{2,5:[#]}: {3}
{4,5:[#]}: {5}
{6}^
{7,5:[#]}: {8}{9}",
fileStr,
zone.Message,
zone.LineNumber - 1,
zone.Extract.Before,
zone.LineNumber,
zone.Extract.Line,
new string('-', zone.Position),
zone.LineNumber + 1,
zone.Extract.After,
callStr);
}