Package com.prineside.tdi2
package com.prineside.tdi2
The game itself.
Some classes in the root of this package are abstract and represent a foundation of a more specific implementations (for example, Tower is the class extended by everything in the .towers package).
The game starts loading from a Game class, which is basically a central point of everything - if you want to better understand the lifecycle of the game, check that class.
-
ClassDescriptionAbilities are temporary effects which are normally started by the player manually (for example,
FireballAbility
orNukeAbility
).Ability.Factory<T extends Ability>Ability type factory is responsible for creation of abilities and provides some additional info for some particular type of ability (such as ability name and color).Buff.Factory<T extends Buff>BuffProcessor<T extends Buff>Placed on PlatformPilesUse this wrapper to store a reference to an enemy (always if there's a chance the enemy will become unregistered between the moment it is stored & stored reference is used in the code) No need to use as method argument / as local variable (if there's no chance for the enemy to become unregistered while it is being used locally)Enemy.Factory<T extends Enemy>A regular projectile which constantly follows the target enemy.Factories provide type-specific info and manage creation / destruction of entities Game (globally) can use them to show info about specific entity types (TowerType / EnemyType / AbilityType etc) Game state (single instance of one game) can also do that but can be modified with scripts - I don't like the fact Enums are used, they don't allow new types of entities - How do we handle global / local factories? We need 2 of them this way - Keeping factories in managers (global only) does not allow to modify them with scripts and makes it more difficult for multithreading / separation of headful and headless modesExplosion.Factory<T extends Explosion>Old version of listeners, still used in some placesIMPORTANT (for me): Do not define basic constructor (SystemName()) to avoid unnecessary actions on deserialization - put some arguments into itThread-local objects, stored in S.TSH Each GameSystemProvider has a single instance of this class and provides objects that were usually available as a regular static fields / singletons Since static fields can not be used in a multithreaded environment and ThreadLocal may get costlyGate.Factory<T extends Gate>Gate.Factory.AbstractFactory<T extends Gate>Item.Factory<T extends Item>Item.Factory.AbstractFactory<T extends Item>ListenerGroup<T extends GameListener>Use instanceof Tile.Pos / Gate.PosMiner.Factory<T extends Miner>Modifier.Factory<T extends Modifier>ModifierProcessor<T extends Modifier>Projectile.Factory<T extends Projectile>A base class of things that store a reference toGameSystemProvider
for its usage.Shape.Factory<T extends Shape>Manages all of the (multi)threading stuff Also triggers the EngineCrash event if it catches an unhandled exception in any of the configured threads Stores crash report in a file and provides methods to get the previous crash report on the next game start.Tile.Factory<T extends Tile>Tile.Factory.AbstractFactory<T extends Tile>Tower.Factory<T extends Tower>Unit.Factory<T extends Unit>Unit.Factory.BasicAbstractFactory<T extends Unit>Шаблон волны Случайным образом генерирует группы врагов в соответствии с номером и типом волны Если enemyCount равен 0, все враги в волне заспавнилисьWaveProcessor.WaveProcessorFactory<T extends WaveProcessor>Волны врагов: Легко: - Обычные (нормально) - Обычные (редко) - Обычные (плотно) - Сильные (нормально) - Сильные (редко) - Быстрые (нормально) - Быстрые (плотно) - Быстрые (редко) Средне: - Воздушные (нормально) - Джет (нормально) - Бронированные (редко) + - Бронированные + обычные (нормально) + - Бронированные + сильные (редко) + - Лечащие + обычные (редко) + - Лечащие (медленные и редкие) + - Лечащие + сильные (редко) + - Лечащие + бронированные + - Джет + лечащие + - Токсичные (нормально) + - Токсичные (плотно) + - Токсичные + бронированные + - Ледяные (плотно) + - Ледяные (нормально) + токсические (нормально) + - Ледяные + лечащие + - Бойцы (редко) + - Бойцы (нормально) + - Бойцы + бронированные + - Легкие (нормально) + - Легкие (плотно) + - Легкие + быстрые +Используется в BasicLevel для волн, которые прописаны заранее (без probability)Динамическая конфигурация волны, используется при процедурной генерации волн (бесконечный режим)