本文整理匯總了C#中fCraft.Map.ResetSpawn方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.ResetSpawn方法的具體用法?C# Map.ResetSpawn怎麽用?C# Map.ResetSpawn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fCraft.Map
的用法示例。
在下文中一共展示了Map.ResetSpawn方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateDefaultMainWorld
static void CreateDefaultMainWorld() {
Map map = new Map( null, 64, 64, 64, true );
MapGenerator.GenerateFlatgrass( map );
map.ResetSpawn();
MainWorld = AddWorld( null, "main", map, true );
}
示例2: AsyncGen
void AsyncGen( object sender, DoWorkEventArgs e ) {
stopwatch = Stopwatch.StartNew();
GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );
Map generatedMap;
if( tab == Tabs.Generator ) {
MapGenerator gen = new MapGenerator( generatorArgs );
gen.ProgressCallback = delegate( object _sender, ProgressChangedEventArgs args ) {
bwGenerator.ReportProgress( args.ProgressPercentage, args.UserState );
};
generatedMap = gen.Generate();
} else {
generatedMap = new Map( null,
Convert.ToInt32( nFlatgrassDimX.Value ),
Convert.ToInt32( nFlatgrassDimY.Value ),
Convert.ToInt32( nFlatgrassDimH.Value ),
true );
MapGenerator.GenerateFlatgrass( generatedMap );
generatedMap.ResetSpawn();
}
if( floodBarrier ) generatedMap.MakeFloodBarrier();
generatedMap.CalculateShadows();
map = generatedMap;
GC.Collect( GC.MaxGeneration, GCCollectionMode.Forced );
}
示例3: LoadMap
public void LoadMap() {
lock( WorldLock ) {
if( Map != null ) return;
try {
Map = MapUtility.Load( GetMapName() );
} catch( Exception ex ) {
Logger.Log( "World.LoadMap: Failed to load map ({0}): {1}", LogType.Error,
GetMapName(), ex );
}
// or generate a default one
if( Map != null ) {
Map.World = this;
} else {
Logger.Log( "World.LoadMap: Generating default flatgrass level.", LogType.SystemActivity );
Map = new Map( this, 64, 64, 64, true );
MapGenerator.GenerateFlatgrass( Map );
Map.ResetSpawn();
}
StartTasks();
if( OnLoaded != null ) OnLoaded();
}
}