• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Sector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Sector的典型用法代码示例。如果您正苦于以下问题:C# Sector类的具体用法?C# Sector怎么用?C# Sector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Sector类属于命名空间,在下文中一共展示了Sector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Load

    public void Load(string Filename)
    {
        List levelLisp = Util.Load(Filename, "supertux-level");

        Properties props = new Properties(levelLisp);
        int version = 1;
        props.Get("version", ref version);
        if(version == 1)
            throw new Exception("Old Level format not supported");
        if(version > 2)
            Console.WriteLine("Warning: Level Format newer than application");

        props.Get("name", ref Name);
        props.Get("author", ref Author);

        LispIterator iter = new LispIterator(levelLisp);
        while(iter.MoveNext()) {
            switch(iter.Key) {
                case "sector":
                    Sector sector = new Sector();
                    sector.Parse(this, iter.List);
                    break;
                default:
                    Console.WriteLine("Ignoring unknown tag '" + iter.Key + "' in level");
                    break;
            }
        }
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:28,代码来源:Level.cs


示例2: CanBeExited

    //Check if a spot has access to the exit of a track.
    public bool CanBeExited(Sector sec)
    {
        Track strck = null;
        int idx=-1;
        foreach(Track trck in Tracks)
        {
            idx = trck.Sectors.FindIndex(p => p.Id == sec.Id);
            if(idx != -1)
            {
                strck = trck;
                break;
            }
        }
        if (strck == null || idx == -1) //Invalid sector (track could not be found)
            return false;
        if (idx == strck.Sectors.Count)
            return true;

        for(int i=idx+1; i<strck.Sectors.Count; i++) //Check if any of the above laying sectors are occupied
        {
            if (strck.Sectors[i].Blocked)
                return false;
        }
        return true;
    }
开发者ID:Zwerik,项目名称:CODEPANDA5,代码行数:26,代码来源:Remise.cs


示例3: CheckIds

    public static void CheckIds(Application application, Sector sector, bool AlertGood)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder("These tilemaps have bad ids in sector " + sector.Name + ":");
        List<int> invalidtiles;
        // Any bad found yet?
        bool bad = false;
        foreach (Tilemap tilemap in sector.GetObjects(typeof(Tilemap))) {
            invalidtiles = CheckIds(tilemap, application.CurrentLevel.Tileset);
            if (invalidtiles.Count != 0) {
                bad = true;
                if (String.IsNullOrEmpty(tilemap.Name))
                    sb.Append(Environment.NewLine + "Tilemap (" + tilemap.Layer + ")");
                else
                    sb.Append(Environment.NewLine + tilemap.Name + " (" + tilemap.Layer + ")");
            }
        }

        MessageType msgtype;
        string message;
        if (! bad) {
            if (! AlertGood)
                return;
            msgtype = MessageType.Info;
            message = "No invalid tile ids in any tilemap in sector " + sector.Name + ".";
        } else {
            msgtype = MessageType.Warning;
            message = sb.ToString();
        }
        MessageDialog md = new MessageDialog(null, DialogFlags.DestroyWithParent,
                                             msgtype, ButtonsType.Close, message);
        md.Run();
        md.Destroy();
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:33,代码来源:QACheck.cs


示例4: ObjectsChanged

    private void ObjectsChanged(Sector sector, IGameObject Object)
    {
        if((Object is IObject) || (Object is Tilemap))
            return;

        UpdateList();
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:7,代码来源:GameObjectListWidget.cs


示例5: SpawnPeople

    public void SpawnPeople(Sector sector)
    {
        int numPeopleOptions = mPeoplePrefabs.Length;
        if(numPeopleOptions <= 0)
        {
            return;
        }

        int numSlots = mSpawnPositions.Length;
        int forceSpawnIndex = Random.Range(0, numSlots); // ensure that at least one person is on this boat

        for(int i = 0; i < numSlots; ++i)
        {
            if(i != forceSpawnIndex && Random.value > 0.6f)
            {
                continue;
            }

            int leftOrRight = (Random.value > 0.5f)?1:-1;
            float range = mBuoyancy.mEndsOffset;
            Vector3 personPos = mSpawnPositions[i].position;
            GameObject prefab = mPeoplePrefabs[Random.Range(0, numPeopleOptions)];
            sector.SpawnEntity(prefab, personPos, transform.up, Vector3.forward*leftOrRight);
        }
    }
开发者ID:SSSS2015,项目名称:SSSS,代码行数:25,代码来源:Boat.cs


示例6: Create

        public Sector Create(Block blockArg, uint sector)
        {
            uint block = blockArg.BlockIndex;
            long totalSectors = blockArg.SectorCount;
            if (sector > totalSectors)
            {
                string message = String.Format("TotalSectors: {0}, Requested Sector:{1}", totalSectors, sector);
                throw new ArgumentOutOfRangeException("sector", message);
            }
            if (!blockFactory.HasData(block))
            {
                return CreateEmptySector(block, sector);
            }

            long currentAddress = blockFactory.GetBlockAddress(block);
            vhdFile.DataReader.SetPosition(currentAddress + (int)VhdConstants.VHD_SECTOR_LENGTH * sector);

            var result = new Sector
                             {
                                 BlockIndex = block,
                                 SectorIndex = sector,
                                 GlobalSectorIndex = this.blockFactory.GetBlockSize() * block + sector,
                                 Data = vhdFile.DataReader.ReadBytes((int)VhdConstants.VHD_SECTOR_LENGTH)
                             };
            return result;
        }
开发者ID:B-Rich,项目名称:azure-sdk-tools,代码行数:26,代码来源:SectorFactory.cs


示例7: ResizeDialog

    public ResizeDialog(Sector sector, Tilemap tilemap)
    {
        this.sector = sector;
        this.tilemap = tilemap;
        Glade.XML gxml = new Glade.XML("editor.glade", "resizeDialog");
        gxml.Autoconnect(this);

        if (resizeDialog == null ||
            XOffsetEntry == null ||
            YOffsetEntry == null ||
            WidthEntry   == null ||
            HeightEntry  == null)
        {
            throw new Exception("Couldn't load resize Dialog");
        }

        if (tilemap == null) {
            XOffsetEntry.Text = "0";
            YOffsetEntry.Text = "0";
            WidthEntry.Text = sector.Width.ToString();
            HeightEntry.Text = sector.Height.ToString();
            undoTitleBase = "Sector \"" + sector.Name + "\"";
        } else {
            XOffsetEntry.Text = "0";
            YOffsetEntry.Text = "0";
            WidthEntry.Text = tilemap.Width.ToString();
            HeightEntry.Text = tilemap.Height.ToString();
            undoTitleBase = "Tilemap \"" + tilemap.Name + "\"";
        }
        resizeDialog.Title += " " + undoTitleBase;
        resizeDialog.Icon = EditorStock.WindowIcon;
        resizeDialog.ShowAll();
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:33,代码来源:ResizeDialog.cs


示例8: Parse

        public override Sector Parse(TextReader reader)
        {
            Sector sector = new Sector();

            StringBuilder accum = new StringBuilder();
            while (true)
            {
                string line = reader.ReadLine();
                if (line == null)
                    break;
                if (Regex.IsMatch(line, @"^\s*$"))
                    continue;
                if (Regex.IsMatch(line, @"^\s*#"))
                    continue;
                if (Char.IsWhiteSpace(line[0]))
                {
                    accum.Append(" ");
                    accum.Append(Regex.Replace(line, @"^\s+", ""));
                    continue;
                }

                if (accum.Length > 0)
                    Apply(accum.ToString(), sector);

                accum.Clear();
                accum.Append(line);
            }
            if (accum.Length > 0)
            {
                Apply(accum.ToString(), sector);
            }

            return sector;
        }
开发者ID:Matt--,项目名称:travellermap,代码行数:34,代码来源:MSECParser.cs


示例9: ObjectCreationTool

    public ObjectCreationTool(Application application,
	                            Sector sector, Type objectType, Sprite Icon)
    {
        this.application = application;
        this.sector = sector;
        this.objectType = objectType;
        this.Icon = Icon;
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:8,代码来源:ObjectCreationTool.cs


示例10: Ship

 public Ship(string name, Ships ships, Sector sector, SectorPosition sectorPosition, Vector3 angle, Tile tile)
 {
     this.name = name;
     this.ships = ships;
     this.sector = sector;
     this.sectorPosition = sectorPosition;
     this.angle = angle;
     this.tilesList.Add(tile);
 }
开发者ID:bondematt,项目名称:SpaceShipGame,代码行数:9,代码来源:Ship.cs


示例11: Parse

        public static Sector Parse(SqlDataReader dr)
        {
            Sector Sector = new Sector();

            Sector.Id = Convert.ToInt32(dr["Id"]);
            Sector.Name = Convert.ToString(dr["Name"]);

            return Sector;
        }
开发者ID:r3plica,项目名称:Boomerang,代码行数:9,代码来源:Sectors.cs


示例12: Tram

 /// <summary>
 /// Initializes a new instance of the <see cref="Tram"/> class.
 /// </summary>
 /// <param name="id">The database ID of the tram.</param>
 /// <param name="number">The identification number (string) of the tram.</param>
 /// <param name="state">The current status of the tram.</param>
 /// <param name="tramType">The tram type of the tram.</param>
 /// <param name="usedForEducationalPurposes">Whether the tram is used for lessons or not.</param>
 /// <param name="sector">The sector on which the tram is standing.</param>
 public Tram(int id, string number, State state, TramType tramType, bool usedForEducationalPurposes, Sector sector)
     : this(id)
 {
     this.Number = number;
     this.State = state;
     this.TramType = tramType;
     this.UsedForEducationalPurposes = usedForEducationalPurposes;
     this.Sector = sector;
 }
开发者ID:Errors4l,项目名称:S21M-ICT4Rails-B,代码行数:18,代码来源:Tram.cs


示例13: Add

		internal void Add( Sector sector )
		{
			sector.PhysicsSpace = world;
			lock ( active_sectors )
			{
				active_sectors.Add( sector );
			}
			world.Add( sector.grid );
		}
开发者ID:d3x0r,项目名称:Voxelarium,代码行数:9,代码来源:Physics.cs


示例14: Player

 public Player(GameObject playerObject)
 {
     this.playerObject = playerObject;
     sector = new Sector();
     sectorPosition = new SectorPosition();
     Vector3 angle = new Vector3(0,0,0);
     ObjectVelocity velocity = new ObjectVelocity();
      	Vector3 angularVelocity = new Vector3(0,0,0);
     updateScriptRef();
 }
开发者ID:bondematt,项目名称:SpaceShipGame,代码行数:10,代码来源:Player.cs


示例15: CreateTabList

    private void CreateTabList()
    {
        foreach(Sector sector in level.Sectors) {
            SectorRenderer Renderer = new SectorRenderer(level, sector);
            Renderer.ShowAll();
            AppendPage(Renderer, new Label(sector.Name));
        }

        if(this.sector == null && level.Sectors.Count > 0)
            this.sector = level.Sectors[0];
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:11,代码来源:SectorSwitchNotebook.cs


示例16: DetalleDiagramacion

 public DetalleDiagramacion(Deporte deporte, int item, string dia_semana, Sector sector, Horario hora_desde,
     Horario hora_hasta, Personal profesor)
 {
     Deporte = deporte;
     Item = item;
     Dia_semana = dia_semana;
     Sector = sector;
     Hora_desde = hora_desde;
     Hora_hasta = hora_hasta;
     Profesor = profesor;
 }
开发者ID:martinc2015,项目名称:KRISMAGIT,代码行数:11,代码来源:DetalleDiagramacion.cs


示例17: SectorRenderer

    public SectorRenderer(Application application, Level level, Sector sector)
    {
        this.application = application;
        this.level = level;
        this.sector = sector;
        Layer layer = new Layer();

        foreach(IDrawableLayer IDrawableLayer in sector.GetObjects(typeof(IDrawableLayer))) {
            Node node = IDrawableLayer.GetSceneGraphNode();
            if (IDrawableLayer is Tilemap)	//Special handling for tilemaps
                node = new TilemapNode((Tilemap) IDrawableLayer, level.Tileset);
            ColorNode colorNode = new ColorNode(node, new Color(1f, 1f, 1f, 1f), true);
            layer.Add(IDrawableLayer.Layer, colorNode);
            colors[IDrawableLayer] = colorNode;
        }

        objectsNode = new NodeWithChilds();
        objectsColorNode = new ColorNode(objectsNode, new Color(1f, 1f, 1f, 1f));
        layer.Add(1, objectsColorNode);

        foreach(IObject Object in sector.GetObjects(typeof(IObject))) {
            Node node = Object.GetSceneGraphNode();
            if(node != null)
                objectsNode.AddChild(node);
        }

        // fill remaining place with one color
        sectorFill = new SceneGraph.Rectangle();
        sectorFill.Fill = true;
        ColorNode color = new ColorNode(sectorFill, new Drawing.Color(0.4f, 0.3f, 0.4f));
        layer.Add(-10000, color);

        // draw border around sector...
        sectorBBox = new SceneGraph.Rectangle();
        sectorBBox.Fill = false;
        color = new ColorNode(sectorBBox, new Drawing.Color(1, 0.3f, 1));
        layer.Add(1000, color);

        // draw border around selected layer...
        color = new ColorNode(new TilemapBorder(application), new Drawing.Color(1, 1, 0));
        layer.Add(1001, color);

        OnSizeChanged(sector);

        this.SceneGraphRoot = layer;

        sector.ObjectAdded += OnObjectAdded;
        sector.ObjectRemoved += OnObjectRemoved;
        sector.SizeChanged += OnSizeChanged;
        application.TilemapChanged += OnTilemapChanged;
        //TODO: It should be possible to iterate over all (currently present?) types that implements ILayer.. How?
        FieldOrProperty.AnyFieldChanged += OnFieldChanged;
    }
开发者ID:Karkus476,项目名称:supertux-editor,代码行数:53,代码来源:SectorRenderer.cs


示例18: SectorRenderer

    public SectorRenderer(Level level, Sector sector)
    {
        this.level = level;
        Layer layer = new Layer();

        backgroundNode = new NodeWithChilds();
        backgroundColorNode = new ColorNode(backgroundNode, new Color(1f, 1f, 1f, 1f));
        layer.Add(-900, backgroundColorNode);
        foreach(Background background in sector.GetObjects(typeof(Background))) {
            Node node = background.GetSceneGraphNode();
            if(node == null) continue;
            backgroundNode.AddChild(node);
        }

        foreach(Tilemap tilemap in sector.GetObjects(typeof(Tilemap))) {
            Node node = new TilemapNode(tilemap, level.Tileset);
            ColorNode colorNode = new ColorNode(node, new Color(1f, 1f, 1f, 1f));
            layer.Add(tilemap.ZPos, colorNode);
            colors[tilemap] = colorNode;
        }

        objectsNode = new NodeWithChilds();
        objectsColorNode = new ColorNode(objectsNode, new Color(1f, 1f, 1f, 1f));
        layer.Add(1, objectsColorNode);

        foreach(IObject Object in sector.GetObjects(typeof(IObject))) {
            Node node = Object.GetSceneGraphNode();
            if(node != null)
                objectsNode.AddChild(node);
        }

        // draw border around sector...
        sectorFill = new SceneGraph.Rectangle();
        sectorFill.Fill = true;
        ColorNode color = new ColorNode(sectorFill, new Drawing.Color(0.4f, 0.3f, 0.4f));
        layer.Add(-10000, color);

        sectorBBox = new SceneGraph.Rectangle();
        sectorBBox.Fill = false;
        color = new ColorNode(sectorBBox, new Drawing.Color(1, 0.3f, 1));
        layer.Add(1000, color);

        OnSizeChanged(sector);

        this.SceneGraphRoot = layer;

        sector.ObjectAdded += OnObjectAdded;
        sector.ObjectRemoved += OnObjectRemoved;
        sector.SizeChanged += OnSizeChanged;

        Drag.DestSet(this, DestDefaults.All, ObjectListWidget.DragTargetEntries, Gdk.DragAction.Default);
        DragMotion += OnDragMotion;
    }
开发者ID:BackupTheBerlios,项目名称:supertux-svn,代码行数:53,代码来源:SectorRenderer.cs


示例19: Edit

 public static void Edit(Sector pSector)
 {
     SqlCommand SQLCmd = new SqlCommand();
     SQLCmd.CommandType = CommandType.StoredProcedure;
     SQLCmd.CommandText = "UpdateSector";
     SQLCmd.Parameters.Add("Id", SqlDbType.Int).Value = pSector.Id;
     SQLCmd.Parameters.Add("ClientId", SqlDbType.Int).Value = pSector.ClientId;
     SQLCmd.Parameters.Add("Name", SqlDbType.NVarChar, 255).Value = pSector.Name;
     BaseDataAccess.OpenConnection(SQLCmd);
     BaseDataAccess.ExecuteNonSelect(SQLCmd);
     BaseDataAccess.CloseConnection();
 }
开发者ID:r3plica,项目名称:Boomerang,代码行数:12,代码来源:Sectors.cs


示例20: GetBlockAt

    public static Block GetBlockAt(Vector3 position, Sector sector = null)
    {
        Block result = null;
        // Get the chunk.
        Chunk chunk = GetChunkAt(position, sector);
        if (chunk != null)
        {
            // Modulo the player's position by the measure of blocks in a chunk to get their position within their chunk.
            result = chunk.blocks[(int)position.x % Chunk.WIDTH, (int)position.y % Chunk.HEIGHT, (int)position.z % Chunk.DEPTH];
        }

        return result;
    }
开发者ID:ChurroLoco,项目名称:space_craft,代码行数:13,代码来源:TerrainControllerScript.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SecureLevel类代码示例发布时间:2022-05-24
下一篇:
C# SectionViewModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap