Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
GameUpdater Class Reference
Inheritance diagram for GameUpdater:
EClass

Classes

class  AreaUpdater
 
class  CharaUpdater
 
class  ConditionUpdater
 
class  FastSurfaceUpdater
 
class  FireUpdater
 
class  LogicUpdater
 
class  SensorUpdater
 
class  SurfaceUpdater
 
class  ThingUpdater
 
class  Updater
 

Public Member Functions

void Reset ()
 
void Update100ms ()
 
void FixedUpdate ()
 
void Update ()
 
string GetText ()
 

Public Attributes

AreaUpdater area
 
SurfaceUpdater surface
 
FastSurfaceUpdater surfaceFast
 
FireUpdater fire
 
CharaUpdater chara
 
ConditionUpdater condition
 
ThingUpdater thing
 
SensorUpdater sensor
 
RecipeUpdater recipe = new RecipeUpdater()
 
Updater[] all
 

Static Public Attributes

static float delta
 
- Static Public Attributes inherited from EClass
static Core core
 

Private Attributes

float dateTimer
 
float counterTimer
 
int counter
 
float timerThunder
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 5 of file GameUpdater.cs.

Member Function Documentation

◆ FixedUpdate()

void GameUpdater.FixedUpdate ( )
inline

Definition at line 436 of file GameUpdater.cs.

437 {
439 if (!EClass.scene.paused)
440 {
441 if (all == null)
442 {
443 all = new Updater[8] { area, surface, surfaceFast, fire, chara, condition, sensor, thing };
444 }
445 delta = Core.delta;
454 }
455 }
Definition: Core.cs:14
static float delta
Definition: Core.cs:17
Definition: EClass.cs:5
static Scene scene
Definition: EClass.cs:30
override void FixedUpdate()
Definition: GameUpdater.cs:42
override void FixedUpdate()
Definition: GameUpdater.cs:246
override void FixedUpdate()
Definition: GameUpdater.cs:284
override void FixedUpdate()
Definition: GameUpdater.cs:185
override void FixedUpdate()
Definition: GameUpdater.cs:224
override void FixedUpdate()
Definition: GameUpdater.cs:72
override void FixedUpdate()
Definition: GameUpdater.cs:317
ConditionUpdater condition
Definition: GameUpdater.cs:357
AreaUpdater area
Definition: GameUpdater.cs:347
FireUpdater fire
Definition: GameUpdater.cs:353
CharaUpdater chara
Definition: GameUpdater.cs:355
SurfaceUpdater surface
Definition: GameUpdater.cs:349
Updater[] all
Definition: GameUpdater.cs:365
static float delta
Definition: GameUpdater.cs:345
SensorUpdater sensor
Definition: GameUpdater.cs:361
RecipeUpdater recipe
Definition: GameUpdater.cs:363
ThingUpdater thing
Definition: GameUpdater.cs:359
FastSurfaceUpdater surfaceFast
Definition: GameUpdater.cs:351
void FixedUpdate()
bool paused
Definition: Scene.cs:134

References all, area, chara, condition, Core.delta, delta, fire, GameUpdater.AreaUpdater.FixedUpdate(), GameUpdater.SurfaceUpdater.FixedUpdate(), GameUpdater.FastSurfaceUpdater.FixedUpdate(), GameUpdater.LogicUpdater.FixedUpdate(), GameUpdater.SensorUpdater.FixedUpdate(), GameUpdater.CharaUpdater.FixedUpdate(), GameUpdater.ConditionUpdater.FixedUpdate(), GameUpdater.ThingUpdater.FixedUpdate(), RecipeUpdater.FixedUpdate(), Scene.paused, recipe, EClass.scene, sensor, surface, surfaceFast, and thing.

Referenced by Game.OnUpdate(), and CoreDebug.UpdateInput().

◆ GetText()

string GameUpdater.GetText ( )
inline

Definition at line 552 of file GameUpdater.cs.

553 {
554 if (all == null)
555 {
556 return "";
557 }
558 string text = "";
559 Updater[] array = all;
560 foreach (Updater updater in array)
561 {
562 text = text + updater.GetType().Name + ": " + updater.updatesPerFrame + " / frame " + updater.maxCount + " in " + updater.duration + "sec \n";
563 }
564 return text;
565 }

References all.

Referenced by WidgetDebug.UpdateText().

◆ Reset()

void GameUpdater.Reset ( )
inline

Definition at line 375 of file GameUpdater.cs.

376 {
377 area = new AreaUpdater();
378 surface = new SurfaceUpdater();
379 surfaceFast = new FastSurfaceUpdater();
380 fire = new FireUpdater();
381 chara = new CharaUpdater();
382 condition = new ConditionUpdater();
383 thing = new ThingUpdater();
384 sensor = new SensorUpdater();
385 }

References area, chara, condition, fire, sensor, surface, surfaceFast, and thing.

Referenced by Scene.Init().

◆ Update()

void GameUpdater.Update ( )
inline

Definition at line 457 of file GameUpdater.cs.

458 {
459 if (EClass.game.activeZone == null)
460 {
461 return;
462 }
464 if (EClass.debug.testLOS)
465 {
467 {
468 Zone zone = EClass.game.spatials.Find("palmia");
470 if (pathProgress.HasPath)
471 {
472 Debug.Log(pathProgress.nodes.Count);
473 foreach (PathFinderNode node in pathProgress.nodes)
474 {
475 Point point2 = new Point(node.X, node.Z);
477 }
478 }
479 }
480 Point hit2 = Scene.HitPoint;
481 if (hit2.IsValid)
482 {
483 for (int i = 0; i < EClass._map.charas.Count; i++)
484 {
485 Chara tg = EClass._map.charas[i];
486 if (!Los.IsVisible(hit2, tg.pos))
487 {
488 continue;
489 }
490 Los.IsVisible(hit2, tg.pos, delegate(Point point, bool blocked)
491 {
493 if (Input.GetKey(KeyCode.LeftControl))
494 {
495 Debug.Log(tg.Name + ": Distance:" + hit2.Distance(tg.pos));
496 }
497 });
498 }
499 }
500 }
502 {
503 Point hit = Scene.HitPoint;
504 if (hit.IsValid)
505 {
506 EClass._map.ForeachSphere(hit.x, hit.z, 6f, delegate(Point p)
507 {
508 if (p.IsValid && Los.IsVisible(hit, p))
509 {
510 EClass.screen.tileMap.passGuideFloor.Add(p, 20f);
511 }
512 });
513 }
514 }
515 if (EClass.scene.paused)
516 {
517 return;
518 }
521 dateTimer += delta;
523 {
524 dateTimer = 0f;
526 }
528 if (!(counterTimer > 0.1f))
529 {
530 return;
531 }
532 counterTimer = 0f;
533 counter++;
534 if (counter == 10)
535 {
536 counter = 0;
537 }
538 switch (counter)
539 {
540 case 1:
542 break;
543 case 5:
544 if ((bool)EClass.Sound.currentAmbience)
545 {
546 EClass.Sound.currentAmbience.TryEmit(EClass.world.date.IsDay, ref Point.shared.Set(EClass.pc.pos.x + EClass.rnd(5) - EClass.rnd(5), EClass.pc.pos.z).Clamp().Position());
547 }
548 break;
549 }
550 }
BaseTileMap tileMap
MeshPass passGuideBlock
Definition: BaseTileMap.cs:137
MeshPass passGuideFloor
Definition: BaseTileMap.cs:139
Point pos
Definition: Card.cs:55
Definition: Chara.cs:10
bool testLOS2
Definition: CoreDebug.cs:149
bool testLOS
Definition: CoreDebug.cs:147
static float gameDelta
Definition: Core.cs:21
bool IsDay
Definition: Date.cs:109
static Game game
Definition: EClass.cs:8
static int rnd(int a)
Definition: EClass.cs:50
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static BaseGameScreen screen
Definition: EClass.cs:32
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static SoundManager Sound
Definition: EClass.cs:46
static GameSetting setting
Definition: EClass.cs:34
int minX
Definition: EloMap.cs:112
int minY
Definition: EloMap.cs:114
void AdvanceMin(int a)
Definition: GameDate.cs:22
float secsPerHour
Definition: GameSetting.cs:319
float dateTimer
Definition: GameUpdater.cs:367
float counterTimer
Definition: GameUpdater.cs:369
SpatialManager spatials
Definition: Game.cs:152
Zone activeZone
Definition: Game.cs:245
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2358
void RefreshSunMap()
Definition: Map.cs:2700
List< Chara > charas
Definition: Map.cs:81
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
static PathManager Instance
Definition: PathManager.cs:16
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
ref Vector3 Position(int height)
Definition: Point.cs:524
Point Set(int _x, int _z)
Definition: Point.cs:479
ref Vector3 PositionTopdown()
Definition: Point.cs:545
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsValid
Definition: Point.cs:88
Point Clamp(bool useBounds=false)
Definition: Point.cs:972
Definition: Scene.cs:8
static Point HitPoint
Definition: Scene.cs:21
EloMap elomap
Definition: Scene.cs:143
Zone Find(string id)
virtual bool IsRegion
Definition: Spatial.cs:501
int y
Definition: Spatial.cs:106
int x
Definition: Spatial.cs:94
static void Refresh()
GameDate date
Definition: World.cs:6
void Tick(float delta)
Definition: Zone.cs:12
ZoneEventManager events
Definition: Zone.cs:40

References EClass._map, EClass._zone, Game.activeZone, MeshPass.Add(), GameDate.AdvanceMin(), Map.charas, Point.Clamp(), counter, counterTimer, World.date, dateTimer, EClass.debug, Debug, delta, Scene.elomap, Zone.events, SpatialManager.Find(), Map.ForeachSphere(), EClass.game, Core.gameDelta, PathProgress.HasPath, Scene.HitPoint, PathManager.Instance, Date.IsDay, Spatial.IsRegion, Point.IsValid, Los.IsVisible(), EloMap.minX, EloMap.minY, PathProgress.nodes, BaseTileMap.passGuideBlock, BaseTileMap.passGuideFloor, Scene.paused, EClass.pc, Card.pos, Point.Position(), Point.PositionTopdown(), UIResourceTrack.Refresh(), Map.RefreshSunMap(), PathManager.RequestPathImmediate(), EClass.rnd(), EClass.scene, EClass.screen, GameSetting.secsPerHour, Point.Set(), EClass.setting, Point.shared, EClass.Sound, Game.spatials, CoreDebug.testLOS, CoreDebug.testLOS2, ZoneEventManager.Tick(), BaseGameScreen.tileMap, EClass.world, Algorithms.PathFinderNode.X, Point.x, Spatial.x, Spatial.y, Algorithms.PathFinderNode.Z, and Point.z.

Referenced by Scene.OnUpdate().

◆ Update100ms()

void GameUpdater.Update100ms ( )
inline

Definition at line 387 of file GameUpdater.cs.

388 {
390 {
392 }
393 bool flag = EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy;
394 bool flag2 = EClass._map.config.indoor || (EClass.pc.IsInActiveZone && (EClass.pc.pos.cell.room?.HasRoof ?? false));
395 bool flag3 = EClass.pc.pos.cell.room?.data.atrium ?? false;
396 float mtpVolume = ((EClass._zone.lv <= -2) ? 0f : ((flag2 && !flag3) ? 0.5f : 1f));
398 {
399 for (int i = 0; i < EClass.setting.weather.splashCount * ((!flag) ? 1 : 2); i++)
400 {
401 Point randomPoint = EClass.screen.GetRandomPoint();
402 if (!randomPoint.IsValid)
403 {
404 continue;
405 }
406 Cell cell = randomPoint.cell;
407 if (!cell.HasRoof && cell._block == 0 && !randomPoint.IsSky)
408 {
409 if (cell.IsTopWaterAndNoSnow)
410 {
411 EClass.scene.psRainSplash.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
412 }
413 else
414 {
415 EClass.scene.psRainSplashWater.Emit(randomPoint.PositionCenter(), Vector3.zero, Rand.Range(0.6f, 1.1f), 0.2f, Color.white);
416 }
417 }
418 }
419 }
420 if (!flag)
421 {
422 return;
423 }
424 timerThunder += 0.1f;
426 {
428 {
429 ScreenFlash.Play("storm" + (EClass.rnd(2) + 1), (flag2 && !flag3) ? 0.3f : 1f);
430 }
431 EClass.Sound.Play("Ambience/Random/storm", mtpVolume);
433 }
434 }
bool atrium
Definition: AreaData.cs:66
AreaData data
Definition: BaseArea.cs:29
Point GetRandomPoint()
Definition: Cell.cs:7
byte _block
Definition: Cell.cs:30
Room room
Definition: Cell.cs:102
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool HasRoof
Definition: Cell.cs:648
GraphicSetting graphic
Definition: CoreConfig.cs:594
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:6
static FactionBranch Branch
Definition: EClass.cs:22
HomeResourceManager resources
WeatherSetting weather
Definition: GameSetting.cs:313
float timerThunder
Definition: GameUpdater.cs:373
bool IsIndoor
Definition: Map.cs:131
bool IsSky
Definition: Point.cs:212
ref Vector3 PositionCenter()
Definition: Point.cs:563
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
bool HasRoof
Definition: Room.cs:29
ParticleSystem psRainSplashWater
Definition: Scene.cs:111
ParticleSystem psRainSplash
Definition: Scene.cs:109
static void Play(string id, float mtp=1f)
Definition: ScreenFlash.cs:24
Condition
Definition: Weather.cs:16
bool IsRaining
Definition: Weather.cs:117
Weather weather
Definition: World.cs:12
bool IsPCFaction
Definition: Zone.cs:464

References Cell._block, EClass._map, Game.activeZone, AreaData.atrium, EClass.Branch, Point.cell, Color, Core.config, EClass.core, BaseArea.data, EClass.game, BaseGameScreen.GetRandomPoint(), CoreConfig.graphic, Cell.HasRoof, Room.HasRoof, HomeResourceManager.isDirty, Map.IsIndoor, Zone.IsPCFaction, Weather.IsRaining, Point.IsSky, Cell.IsTopWaterAndNoSnow, Point.IsValid, CoreConfig.GraphicSetting.noLightning, EClass.pc, ScreenFlash.Play(), Card.pos, Point.PositionCenter(), Scene.psRainSplash, Scene.psRainSplashWater, Rand.Range(), HomeResourceManager.Refresh(), FactionBranch.resources, EClass.rnd(), Cell.room, EClass.scene, EClass.screen, EClass.setting, EClass.Sound, GameSetting.WeatherSetting.thunerInterval, timerThunder, GameSetting.weather, World.weather, and EClass.world.

Referenced by Core.Update100ms().

Member Data Documentation

◆ all

Updater [] GameUpdater.all

Definition at line 365 of file GameUpdater.cs.

Referenced by FixedUpdate(), and GetText().

◆ area

AreaUpdater GameUpdater.area

Definition at line 347 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ chara

◆ condition

ConditionUpdater GameUpdater.condition

Definition at line 357 of file GameUpdater.cs.

Referenced by GameUpdater.ConditionUpdater.FixedUpdate(), FixedUpdate(), and Reset().

◆ counter

int GameUpdater.counter
private

Definition at line 371 of file GameUpdater.cs.

Referenced by Update().

◆ counterTimer

float GameUpdater.counterTimer
private

Definition at line 369 of file GameUpdater.cs.

Referenced by Update().

◆ dateTimer

float GameUpdater.dateTimer
private

Definition at line 367 of file GameUpdater.cs.

Referenced by Update().

◆ delta

float GameUpdater.delta
static

Definition at line 345 of file GameUpdater.cs.

Referenced by FixedUpdate(), GameUpdater.Updater.SetUpdatesPerFrame(), and Update().

◆ fire

FireUpdater GameUpdater.fire

Definition at line 353 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ recipe

◆ sensor

SensorUpdater GameUpdater.sensor

Definition at line 361 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surface

SurfaceUpdater GameUpdater.surface

Definition at line 349 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ surfaceFast

FastSurfaceUpdater GameUpdater.surfaceFast

Definition at line 351 of file GameUpdater.cs.

Referenced by FixedUpdate(), and Reset().

◆ thing

ThingUpdater GameUpdater.thing

Definition at line 359 of file GameUpdater.cs.

Referenced by GameUpdater.ThingUpdater.FixedUpdate(), FixedUpdate(), and Reset().

◆ timerThunder

float GameUpdater.timerThunder
private

Definition at line 373 of file GameUpdater.cs.

Referenced by Update100ms().


The documentation for this class was generated from the following file: