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

C# fCraft.World类代码示例

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

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



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

示例1: FeedData

        public FeedData( Block _textType, Vector3I _pos, Bitmap Image, World world, Direction direction_, Player player_ )
        {
            direction = direction_;
            Blocks = new ConcurrentDictionary<string, Vector3I>();
            Init( Image, world );
            Pos = _pos;
            textType = ( byte )_textType;
            bgType = ( byte )Block.Air;
            FeedData.AddMessages();
            MessageCount = 0;
            Sentence = FeedData.Messages[MessageCount];
            Id = System.Threading.Interlocked.Increment( ref feedCounter );
            player = player_;
            NormalBrush brush = new NormalBrush( Block.Wood );
            DrawOperation Operation = new CuboidWireframeDrawOperation( player );
            Operation.AnnounceCompletion = false;
            Operation.Brush = brush;
            Operation.Context = BlockChangeContext.Drawn;

            if ( !Operation.Prepare( new Vector3I[] { StartPos, FinishPos } ) ) {
                throw new Exception( "Unable to cubw frame." );
            }

            Operation.Begin();
            AddFeedToList( this, world );

            Start();
        }
开发者ID:Jonty800,项目名称:800Craft-SMP,代码行数:28,代码来源:FeedData.cs


示例2: PlayerProximityTracker

        private World _world = null; //to be able to remove players left the game

        #endregion Fields

        #region Constructors

        public PlayerProximityTracker( int xSize, int ySize, World world )
        {
            _players = new List<Player>[xSize, ySize];
            foreach ( Player p in world.Players ) {
                AddPlayer( p, p.Position.ToBlockCoords() );
            }
        }
开发者ID:GlennMR,项目名称:800craft,代码行数:13,代码来源:PlayerProximityTracker.cs


示例3: StartUp

        void StartUp( object sender, EventArgs a ) {
            world = new World( "" );

            world.OnLog += Log;
            world.OnURLChange += SetURL;
            world.OnPlayerListChange += UpdatePlayerList;


            if( world.Init() ) {
                Text = "fCraft " + Updater.GetVersionString() + " - " + world.config.GetString( "ServerName" );

                UpdaterResult update = Updater.CheckForUpdates( world );
                if( update.UpdateAvailable ) {
                    if( world.config.GetString( "AutomaticUpdates" ) == "Notify" ) {
                        Log( String.Format( Environment.NewLine +
                                            "*** A new version of fCraft is available: v{0:0.000}, released {1:0} day(s) ago. ***"+
                                            Environment.NewLine,
                                            Decimal.Divide( update.NewVersionNumber, 1000 ),
                                            DateTime.Now.Subtract( update.ReleaseDate ).TotalDays ), LogType.ConsoleOutput );
                        StartServer();
                    } else {
                        UpdateWindow updateWindow = new UpdateWindow( update, this, world.config.GetString( "AutomaticUpdates" ) == "Auto" );
                        updateWindow.StartPosition = FormStartPosition.CenterParent;
                        updateWindow.ShowDialog();
                    }
                } else {
                    StartServer();
                }
            } else {
                world.log.Log( "---- Could Not Initialize World ----", LogType.FatalError );
                world = null;
            }
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:33,代码来源:UI.cs


示例4: MakeNormalFoliage

        public static void MakeNormalFoliage( World w, Vector3I Pos, int Height )
        {
            int topy = Pos.Z + Height - 1;
            int start = topy - 2;
            int end = topy + 2;

            for ( int y = start; y < end; y++ ) {
                int rad;
                if ( y > start + 1 ) {
                    rad = 1;
                } else {
                    rad = 2;
                }
                for ( int xoff = -rad; xoff < rad + 1; xoff++ ) {
                    for ( int zoff = -rad; zoff < rad + 1; zoff++ ) {
                        if ( w.Map != null && w.IsLoaded ) {
                            if ( Rand.NextDouble() > .618 &&
                                Math.Abs( xoff ) == Math.Abs( zoff ) &&
                                Math.Abs( xoff ) == rad ) {
                                continue;
                            }
                            w.Map.QueueUpdate( new
                                 BlockUpdate( null, ( short )( Pos.X + xoff ), ( short )( Pos.Y + zoff ), ( short )y, Block.Leaves ) );
                        }
                    }
                }
            }
        }
开发者ID:GlennMR,项目名称:800craft,代码行数:28,代码来源:TreeGeneration.cs


示例5: Session

        public Session( World _world, TcpClient _client ) {

            world = _world;
            loginTime = DateTime.Now;

            canReceive = true;
            canQueue = true;
            canSend = false;
            canDispose = false;

            outputQueue = new Queue<Packet>();
            priorityOutputQueue = new Queue<Packet>();
            queueLock = new object();
            priorityQueueLock = new object();

            client = _client;
            client.SendTimeout = 10000;
            client.ReceiveTimeout = 10000;
            
            reader = new BinaryReader( client.GetStream() );
            writer = new PacketWriter( new BinaryWriter( client.GetStream() ) );

            world.log.Log( "Session: {0}", LogType.Debug, ToString() );

            ioThread = new Thread( IoLoop );
            ioThread.IsBackground = true;
            ioThread.Start();
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:28,代码来源:Session.cs


示例6: BlockFloat

 public BlockFloat(World world, Vector3I position, Block Type)
     : base(world)
 {
     _pos = position;
     _nextPos = position.Z + 1;
     type = Type;
 }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:7,代码来源:WaterPhysics.cs


示例7: FireworkParticle

 public FireworkParticle(World world, Vector3I pos, Block block)
     : base(world)
 {
     _startingPos = pos;
     _nextZ = pos.Z - 1;
     _block = block;
 }
开发者ID:EricKilla,项目名称:LegendCraft,代码行数:7,代码来源:ParticleSystem.cs


示例8: Player

 // This constructor is used to create dummy players (such as Console and /dummy)
 // It will soon be replaced by a generic Entity class
 internal Player( World world, string name ) {
     if( name == null ) throw new ArgumentNullException( "name" );
     World = world;
     Info = new PlayerInfo( name, RankManager.HighestRank, true, RankChangeType.AutoPromoted );
     spamBlockLog = new Queue<DateTime>( Info.Rank.AntiGriefBlocks );
     ResetAllBinds();
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:9,代码来源:Player.cs


示例9: SandTask

 public SandTask(World world, Vector3I position, Block Type)
     : base(world)
 {
     _pos = position;
     _nextPos = position.Z - 1;
     _type = Type;
 }
开发者ID:GMathioud,项目名称:MyCraft,代码行数:7,代码来源:SandPhysics.cs


示例10: PlayerInfo

        // generate info for a new player
        public PlayerInfo( World world, Player player ) {
            name = player.name;
            lastIP = player.session.GetIP();

            playerClass = world.classes.defaultClass;
            classChangeDate = DateTime.MinValue;
            classChangedBy = "-";

            banned = false;
            banDate = DateTime.MinValue;
            bannedBy = "-";
            unbanDate = DateTime.MinValue;
            unbannedBy = "-";
            banReason = "-";
            unbanReason = "-";

            lastFailedLoginDate = DateTime.MinValue;
            lastFailedLoginIP = IPAddress.None;
            failedLoginCount = 0;

            firstLoginDate = DateTime.Now;
            lastLoginDate = firstLoginDate;

            totalTimeOnServer = new TimeSpan( 0 );
            blocksBuilt = 0;
            blocksDeleted = 0;
            timesVisited = 1;

            linesWritten = 0;
            thanksReceived = 0;
            warningsReceived = 0;
        }
开发者ID:fragmer,项目名称:fCraft,代码行数:33,代码来源:PlayerInfo.cs


示例11: Player

 // This constructor is used to create dummy players (such as Console and /dummy)
 // It will soon be replaced by a generic Entity class
 internal Player( World _world, string _name )
 {
     world = _world;
     name = _name;
     nick = name;
     info = new PlayerInfo( _name, ClassList.highestClass );
 }
开发者ID:asiekierka,项目名称:afCraft,代码行数:9,代码来源:Player.cs


示例12: Commands

 internal Commands( World _world ) {
     world = _world;
     mapCommands = new MapCommands( world, this );
     blockCommands = new BlockCommands( world, this );
     infoCommands = new InfoCommands( world, this );
     standardCommands = new StandardCommands( world, this );
     drawCommands = new DrawCommands( world, this );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:8,代码来源:Commands.cs


示例13: 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


示例14: GameAdder

 public static void GameAdder(World world)
 {
     world.Games.Add(pinkPlatform);
     world.Games.Add(shootBlack);
     world.Games.Add(math1);
     world.Games.Add(math2);
     world.Games.Add(getOffGrass);
 }
开发者ID:Bedrok,项目名称:800craft,代码行数:8,代码来源:MineChallenge.cs


示例15: BlockCommands

 // Register help commands
 internal BlockCommands( World _world, Commands commands ) {
     world = _world;
     commands.AddCommand( "grass", Grass, false );
     commands.AddCommand( "water", Water, false );
     commands.AddCommand( "lava", Lava, false );
     commands.AddCommand( "solid", Solid, false );
     commands.AddCommand( "s", Solid, false );
     commands.AddCommand( "paint", Paint, false );
     //CommandUtils.AddCommand( "sand", Sand ); // TODO: after sand sim is done
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:11,代码来源:BlockCommands.cs


示例16: DrawCommands

 internal DrawCommands( World _world, Commands commands ) {
     world = _world;
     commands.AddCommand( "cuboid", Cuboid, true );
     commands.AddCommand( "cub", Cuboid, true );
     commands.AddCommand( "ellipsoid", Ellipsoid, true );
     commands.AddCommand( "ell", Ellipsoid, true );
     commands.AddCommand( "mark", Mark, true );
     commands.AddCommand( "undo", UndoDraw, true );
     commands.AddCommand( "cancel", CancelDraw, true );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:10,代码来源:DrawCommands.cs


示例17: ZombieGame

 public ZombieGame( World world )
 {
     _world = world;
     startTime = DateTime.Now;
     _humanCount = _world.Players.Length;
     _task = new SchedulerTask( Interval, false ).RunForever( TimeSpan.FromSeconds( 1 ) );
     _world.gameMode = GameMode.ZombieSurvival;
     Player.Moved += OnPlayerMoved;
     Player.JoinedWorld += OnChangedWorld;
 }
开发者ID:727021,项目名称:800craft,代码行数:10,代码来源:ZombieGame.cs


示例18: GetInstance

 public static TeamDeathMatch GetInstance(World world)
 {
     if (instance == null)
     {
         TDMworld_ = world;
         instance = new TeamDeathMatch();
         startTime = DateTime.UtcNow;
         task_ = new SchedulerTask(Interval, true).RunForever(TimeSpan.FromSeconds(1));
     }
     return instance;
 }
开发者ID:venofox,项目名称:AtomicCraft,代码行数:11,代码来源:TeamDeathMatch.cs


示例19: 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


示例20: InfoCommands

 // Register help commands
 internal InfoCommands( World _world, Commands commands ){
     world = _world;
     commands.AddCommand( "help", Help, true );
     commands.AddCommand( "info", Info, true );
     commands.AddCommand( "baninfo", BanInfo, true );
     commands.AddCommand( "class", ClassInfo, true );
     commands.AddCommand( "rules", Rules, true );
     
     commands.AddCommand( "where", Compass, false );
     commands.AddCommand( "compass", Compass, false );
 }
开发者ID:fragmer,项目名称:fCraft,代码行数:12,代码来源:InfoCommands.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Drawing.DrawOperation类代码示例发布时间:2022-05-26
下一篇:
C# fCraft.SchedulerTask类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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