当前位置: 首页>>代码示例>>C#>>正文


C# Zone类代码示例

本文整理汇总了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 };
        }
开发者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


注:本文中的Zone类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。