本文整理汇总了C#中Zone类的典型用法代码示例。如果您正苦于以下问题:C# Zone类的具体用法?C# Zone怎么用?C# Zone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Zone类属于命名空间,在下文中一共展示了Zone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 };
}
开发者ID:mavenius,项目名称:MiLight.Net,代码行数:31,代码来源:Colour.cs
示例2: Reset
public void Reset()
{
Waypoints.Clear();
Zone = Zone.Unknown;
_position = 0;
_positions.Clear();
}
开发者ID:EasyFarm,项目名称:EasyFarm,代码行数:7,代码来源:Route.cs
示例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;
}
}
开发者ID:rpallarino3,项目名称:Test2DGame,代码行数:32,代码来源:SteppingStone.cs
示例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 }
};
}
开发者ID:redinkinc,项目名称:DynamoPlus,代码行数:32,代码来源:Scripts.cs
示例5: ZoneOrder
public ZoneOrder(Zone zone, bool isAllowed, Dictionary<PlayerIndex, Player> players)
{
this.isAllowed = isAllowed;
this.zone = zone;
this.players = players;
duration = 9;
}
开发者ID:bergerbo,项目名称:ggj2016,代码行数:7,代码来源:ZoneOrder.cs
示例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);
}
开发者ID:Ralphvanderneut,项目名称:dotless,代码行数:27,代码来源:HtmlStylizer.cs
示例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);
}
开发者ID:Remo,项目名称:MediaData,代码行数:34,代码来源:TimeZoneHandler.cs
示例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);
}
开发者ID:Gayo,项目名称:Gayo-CAROT,代码行数:28,代码来源:TileEngine.cs
示例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;
}
开发者ID:AMEE,项目名称:revit,代码行数:11,代码来源:ZoneNode.cs
示例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); //
}
开发者ID:JasonCline,项目名称:dotless,代码行数:25,代码来源:HtmlStylizer.cs
示例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;
}
}
}
开发者ID:KalOnline,项目名称:KaLua,代码行数:31,代码来源:M_Map.cs
示例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);
}
开发者ID:vividentity,项目名称:Oxide2Plugins,代码行数:7,代码来源:ZoneManager.cs
示例13: GoToZoneAct
public GoToZoneAct(CreatureAI agent, Zone zone)
: base(agent)
{
Tree = null;
Name = "Goto zone : " + zone.ID;
Destination = zone;
}
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:GoToZoneAct.cs
示例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;
}
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:PutItemWithTagTask.cs
示例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);
}
开发者ID:nlerikheemskerk,项目名称:cassette,代码行数:32,代码来源:PlainStylizer.cs
示例16: CustomerDroppedInZone
public void CustomerDroppedInZone(Zone zone)
{
GameObject feedbackIcon = Instantiate(God.instance.feedbackIconPrefab, transform.position, Quaternion.identity) as GameObject;
Customer.ZoneMatchingResults result = customerModel.DroppedInZone(zone);
if (result == Customer.ZoneMatchingResults.Fail)
{
feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.Fail;
AudioManager.instance.PlayAudioForIcon(FeedbackIcon.Icons.Fail);
GetComponent<UIDragDropItem>().enabled = false;
customerModel.Die();
return;
}
else if (result == Customer.ZoneMatchingResults.SecondBest)
{
//Should create little icon customer here?
feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.SecondBestOption;
}
else
{
//Should create little icon customer here?
feedbackIcon.GetComponent<FeedbackIcon>().icon = FeedbackIcon.Icons.BestOption;
}
GetComponent<UIDragDropItem>().enabled = false;
zone.AddCustomer(customerModel);
AudioManager.instance.PlayAudioForIcon(feedbackIcon.GetComponent<FeedbackIcon>().icon);
// transform.parent = null;
DestroyCustomerView();
}
开发者ID:vorrin,项目名称:store-game,代码行数:28,代码来源:CustomerView.cs
示例17: navigatePath
private void navigatePath()
{
_pathIterator++;
nextZone = _path[_path.Count - 1];
_path.RemoveAt(_path.Count - 1);
Vector3 diff = gameObject.transform.position - nextZone.transform.position;
if(diff != Vector3.zero)
{
if(Mathf.Abs(diff.x) > Mathf.Abs(diff.y))
{
if(diff.x < 0) _animator.SetInteger("Direction", (int) DIRECTIONS.RIGHT);
else _animator.SetInteger("Direction", (int) DIRECTIONS.LEFT);
}
else
{
if(diff.y < 0) _animator.SetInteger("Direction", (int) DIRECTIONS.UP);
else _animator.SetInteger("Direction", (int) DIRECTIONS.DOWN);
}
iTween.MoveTo(gameObject, iTween.Hash("x", nextZone.position.x, "y", nextZone.position.y, "easeType", "easeOutExpo", "oncomplete", "navigateToZoneComplete"));
}
else navigatePath();
}
开发者ID:rowenar11,项目名称:digiforge,代码行数:26,代码来源:BaseEnemy.cs
示例18: Save
public string Save(Zone zone)
{
int totalzonetype = zoneGateway.GetCountZoneType();
if (zone.TypeName == string.Empty)
{
return "Zone Name is missing";
}
else if (zoneGateway.IsThisZoneExists(zone.TypeName))
{
return "This Zone already Exists";
}
else
{
int value = zoneGateway.Save(zone);
if (value > 0)
{
return "Save Successfully";
}
else
{
return "Save Failed";
}
}
}
开发者ID:SyedArifulIslamEmon,项目名称:FairManagementDB,代码行数:28,代码来源:ZoneManager.cs
示例19: PutItemInZoneTask
public PutItemInZoneTask(Item item, Zone zone)
{
Name = "Put Item: " + item.ID + " in zone " + zone.ID;
Item = item;
Zone = zone;
Priority = PriorityType.Low;
}
开发者ID:scorvi,项目名称:dwarfcorp,代码行数:7,代码来源:PutItemInZoneTask.cs
示例20: Worker_DoWork
void Worker_DoWork(object sender, DoWorkEventArgs e)
{
// If the program is not running or the zone is the same
// bail out.
if (!IsWorking || _zone == _fface.Player.Zone)
{
_zone = _fface.Player.Zone;
return;
}
App.InformUser("Program Paused");
// Stop the state machine.
StateMachine.Stop();
// Set up waiting of 5 seconds to be our current time + 10 seconds.
var waitDelay = DateTime.Now.Add(TimeSpan.FromSeconds(10));
// Wait for five seconds after zoning.
while (DateTime.Now < waitDelay) { }
// Start up the state machine again.
StateMachine.Start();
// Set our zone to our new zone.
_zone = _fface.Player.Zone;
App.InformUser("Program Resumed");
}
开发者ID:jedicbuk,项目名称:EasyFarm,代码行数:29,代码来源:GameEngine.cs
注:本文中的Zone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论