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


C# fCraft.Position类代码示例

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


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

示例1: Player

 // Normal constructor
 internal Player( World _world, string _name, Session _session, Position _pos ) {
     world = _world;
     name = _name;
     nick = name;
     session = _session;
     pos = _pos;
     info = world.db.FindPlayerInfo( this );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:Player.cs

示例2: MakeMove

 internal static Packet MakeMove( int id, Position pos )
 {
     Packet packet = new Packet( OpCode.Move );
     packet.Data[1] = ( byte )id;
     packet.Data[2] = ( byte )pos.X;
     packet.Data[3] = ( byte )pos.Z;
     packet.Data[4] = ( byte )pos.Y;
     return packet;
 }
开发者ID:Jonty800,项目名称:Guilds,代码行数:9,代码来源:Packets.cs

示例3: WriteTeleport

 public void WriteTeleport( byte id, Position pos ) {
     Write( OpCode.Teleport );
     Write( id );
     Write( pos.X );
     Write( pos.Z );
     Write( pos.Y );
     Write( pos.R );
     Write( pos.L );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:PacketWriter.cs

示例4: WriteAddEntity

 public void WriteAddEntity( byte id, string name, Position pos ) {
     Write( OutputCodes.AddEntity );
     Write( id );
     Write( name );
     Write( (short)pos.x );
     Write( (short)pos.h );
     Write( (short)pos.y );
     Write( pos.r );
     Write( pos.l );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:PacketWriter.cs

示例5: Player

 // Normal constructor
 internal Player( World world, string name, Session session, Position position ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     if( session == null ) throw new ArgumentNullException( "session" );
     World = world;
     Session = session;
     Position = position;
     Info = PlayerDB.FindOrCreateInfoForPlayer( name, session.IP );
     spamBlockLog = new Queue<DateTime>( Info.Rank.AntiGriefBlocks );
     ResetAllBinds();
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:11,代码来源:Player.cs

示例6: Bot

 public Bot(string name, Position Pos)
 {
     this.name = name;
     this.playerID = 1;
     pos = Pos;
     heading = 0;
     pitch = 0;
     time = 0;
     update = true;
 }
开发者ID:GMathioud,项目名称:MyCraft,代码行数:10,代码来源:PathFinding.cs

示例7: MakeTeleport

 public static Packet MakeTeleport( sbyte id, Position pos ) {
     Packet packet = new Packet( OpCode.Teleport );
     packet.Bytes[1] = (byte)id;
     ToNetOrder( pos.X, packet.Bytes, 2 );
     ToNetOrder( pos.Z, packet.Bytes, 4 );
     ToNetOrder( pos.Y, packet.Bytes, 6 );
     packet.Bytes[8] = pos.R;
     packet.Bytes[9] = pos.L;
     return packet;
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:Packet.cs

示例8: MakeMoveRotate

 internal static Packet MakeMoveRotate( int id, Position pos )
 {
     Packet packet = new Packet( OpCode.MoveRotate );
     packet.Data[1] = ( byte )id;
     packet.Data[2] = ( byte )( pos.X & 0xFF );
     packet.Data[3] = ( byte )( pos.Z & 0xFF );
     packet.Data[4] = ( byte )( pos.Y & 0xFF );
     packet.Data[5] = pos.R;
     packet.Data[6] = pos.L;
     return packet;
 }
开发者ID:Jonty800,项目名称:Guilds,代码行数:11,代码来源:Packets.cs

示例9: WriteAddEntity

 public void WriteAddEntity( byte id, Player player, Position pos )
 {
     Write( OutputCodes.AddEntity );
     Write( id );
     Write( player.GetListName() );
     Write( (short)pos.x );
     Write( (short)pos.h );
     Write( (short)pos.y );
     Write( pos.r );
     Write( pos.l );
 }
开发者ID:asiekierka,项目名称:afCraft,代码行数:11,代码来源:PacketWriter.cs

示例10: setBot

        /// <summary>
        /// Sets a bot, as well as the bot values. Must be called before any other bot classes.
        /// </summary>
        public void setBot(String botName, String skinName, String modelName, World botWorld, Position pos, sbyte entityID) {
            Name = botName;
            SkinName =  (skinName ?? SkinName);
            Model =  (modelName ?? Model);
            World = botWorld;
            Position = pos;
            ID = entityID;

            World.Bots.Add(this);
            Server.SaveEntity(this);
        }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:14,代码来源:Bot.cs

示例11: Bot

        private bool _isMoving; //if the bot can move, can be changed if it is not boxed in ect

        #endregion Fields

        #region Constructors

        public Bot(string name, Position pos, int iD, World world_)
        {
            Name = name; //bots should be gray :P
            Pos = pos;
            ID = iD;
            world = world_;
            _isMoving = false;
            _direction = Direction.South; //start off at south
            StartNewAIMovement(); //start the while loop in a new thread. I want to change the way the thread works
            //its only like this for testing purposes
        }
开发者ID:tboxx,项目名称:800craft-1,代码行数:17,代码来源:Bot.cs

示例12: WriteAddEntity

 public void WriteAddEntity( byte id, [NotNull] Player player, Position pos ) {
     if( player == null ) throw new ArgumentNullException( "player" );
     Write( OpCode.AddEntity );
     Write( id );
     Write( player.ListName );
     Write( pos.X );
     Write( pos.Z );
     Write( pos.Y );
     Write( pos.R );
     Write( pos.L );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:11,代码来源:PacketWriter.cs

示例13: MakeAddEntity

        public static Packet MakeAddEntity( sbyte id, [NotNull] string name, Position pos ) {
            if( name == null ) throw new ArgumentNullException( "name" );

            Packet packet = new Packet( OpCode.AddEntity );
            packet.Bytes[1] = (byte)id;
            Encoding.ASCII.GetBytes( name.PadRight( 64 ), 0, 64, packet.Bytes, 2 );
            ToNetOrder( pos.X, packet.Bytes, 66 );
            ToNetOrder( pos.Z, packet.Bytes, 68 );
            ToNetOrder( pos.Y, packet.Bytes, 70 );
            packet.Bytes[72] = pos.R;
            packet.Bytes[73] = pos.L;
            return packet;
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:13,代码来源:Packet.cs

示例14: MakeAddEntity

 /// <summary> Creates a new AddEntity (0x07) packet. </summary>
 /// <param name="id"> Entity ID. Negative values refer to "self". </param>
 /// <param name="name"> Entity name. May not be null. </param>
 /// <param name="spawnPosition"> Spawning position for the player. </param>
 /// <exception cref="ArgumentNullException"> name is null </exception>
 public static Packet MakeAddEntity( sbyte id, [NotNull] string name, Position spawnPosition ) {
     if (name == null) throw new ArgumentNullException("name");
     
     Packet packet = new Packet( OpCode.AddEntity );
     //Logger.Log(LogType.Debug, "Send: MakeAddEntity({0}, {1}, {2})", id, name, spawnPosition);
     packet.Bytes[1] = (byte)id;
     Encoding.ASCII.GetBytes( name.PadRight( 64 ), 0, 64, packet.Bytes, 2 );
     ToNetOrder( spawnPosition.X, packet.Bytes, 66 );
     ToNetOrder( spawnPosition.Z, packet.Bytes, 68 );
     ToNetOrder( spawnPosition.Y, packet.Bytes, 70 );
     packet.Bytes[72] = spawnPosition.R;
     packet.Bytes[73] = spawnPosition.L;
     return packet;
 }
开发者ID:Magi1053,项目名称:ProCraft,代码行数:19,代码来源:Packet.cs

示例15: MakeZone

 static void MakeZone( Player player, Position[] marks, object tag ) {
     Zone zone = (Zone)tag;
     zone.xMin = Math.Min( marks[0].x, marks[1].x );
     zone.xMax = Math.Max( marks[0].x, marks[1].x );
     zone.yMin = Math.Min( marks[0].y, marks[1].y );
     zone.yMax = Math.Max( marks[0].y, marks[1].y );
     zone.hMin = Math.Min( marks[0].h, marks[1].h );
     zone.hMax = Math.Max( marks[0].h, marks[1].h );
     player.Message( "Zone \"" + zone.name + "\" created, " + zone.getVolume() + " blocks total." );
     player.world.log.Log( "Player {0} created a new zone \"{1}\" containing {2} blocks.", LogType.UserActivity,
                           player.name,
                           zone.name,
                           zone.getVolume() );
     player.world.map.zones.Add( zone );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:15,代码来源:MapCommands.cs


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