當前位置: 首頁>>代碼示例>>C#>>正文


C# fCraft.World類代碼示例

本文整理匯總了C#中fCraft.World的典型用法代碼示例。如果您正苦於以下問題:C# World類的具體用法?C# World怎麽用?C# World使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


World類屬於fCraft命名空間,在下文中一共展示了World類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的fCraft.World類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。