Leviathan  0.8.0.0
Leviathan game engine
Leviathan Namespace Reference

The access mask controls which registered functions and classes a script sees. More...

Namespaces

 Editor
 
 GUI
 
 KeyMapping
 
 MMath
 
 Script
 
 Sound
 
 Test
 

Classes

struct  AngelScriptTypeIDResolver
 
struct  AngelScriptTypeIDResolver< asIScriptFunction * >
 
struct  AngelScriptTypeIDResolver< asIScriptObject * >
 
struct  AngelScriptTypeIDResolver< void >
 
class  Animated
 Entity plays animations on an Ogre::Item. More...
 
class  AnimationSystem
 Handles updating time of Ogre animations. More...
 
class  AppDef
 
class  AudioSource
 Small ReferenceCounted wrapper around an audio source. More...
 
class  AutoUpdateableObject
 
class  BaseComponentState
 Base for all component state classes. More...
 
class  BaseDelegateSlot
 Base class for all delegate types. More...
 
class  BaseEventData
 Base type for all event data types. More...
 
class  BaseGameSpecificPacketFactory
 Base class that is passed to the list of type handlers to GameSpecificPacketHandler. More...
 
class  BaseGameSpecificRequestPacket
 Base class for all user defined request packets. More...
 
class  BaseGameSpecificResponsePacket
 Base class for all user defined response packets. More...
 
class  BaseNotifiable
 
class  BaseNotifiableAll
 Specialized class for accepting all parent/child objects. More...
 
class  BaseNotifier
 
class  BaseNotifierAll
 Specialized class for accepting all parent/child objects. More...
 
class  BasicPool
 A tiny wrapper around boost pool. More...
 
class  BoxGeometry
 Entity has a box for geometry/model, possibly also physics. More...
 
class  CachedComponentCollectionHolder
 
class  CallableObject
 
class  Camera
 Properties that a camera entity has (will also need a Position component) More...
 
class  CEFApplicationKeeper
 Keeps certain CEF objects allocated for long enough. More...
 
class  CharWithIndex
 Helper class for indexing. More...
 
class  ClientApplication
 
class  ClientInterpolationEventData
 Data for EVENT_TYPE_CLIENT_INTERPOLATION. More...
 
class  CommandHandler
 Handles all commands sent by the players on the server. More...
 
class  CommandSender
 Represents an entity that can execute commands. More...
 
class  ComplainOnce
 Prints a warning or an error once. More...
 
class  Component
 Base class for all components. More...
 
class  ComponentHolder
 
struct  ComponentTypeInfo
 
class  ComponentWithStates
 Alternative base class for Component that creates distinct state objects. More...
 
class  ConditionalDelayedTask
 Encapsulates a function that can later be ran in a free thread. More...
 
class  ConditionalTask
 Encapsulates a function that can later be ran in a free thread. More...
 
class  ConnectedPlayer
 A class that represents a human player. More...
 
class  Connection
 Class that handles a single connection to another instance. More...
 
class  ConsoleInput
 
class  ConsoleLogger
 Logger for console output to the standard logger. More...
 
class  Convert
 Holds common conversion functions. More...
 
class  CrashHandler
 An orchestrator for crashing. More...
 
class  CustomCommandHandler
 Implement this interface to be able to handle custom commands. More...
 
class  CustomScriptRun
 Contains data for script runs where arguments are passed manually. More...
 
class  DataBlock
 Main DataBlock class. More...
 
class  DataBlock< DBlockT * >
 
class  DataBlockAll
 
struct  DataBlockConversionResolver
 
class  DataBlockConverter
 
class  DataBlockConverter< FromDataBlockType, std::string >
 
class  DataBlockConverter< FromDataBlockType, std::wstring >
 
struct  DataBlockNameResolver
 
struct  DataListener
 
struct  DataListenHolder
 
class  DataStore
 
class  DebugVariableNotifier
 
class  DelayedTask
 Encapsulates a function that is ran after a time period. More...
 
class  Delegate
 An object which can accept BaseDelegateSlot derived callbacks that can be called when the event represented by this delegate is called. More...
 
class  EmptyVisitor
 Example visitor that does nothing, but doesn't crash either. More...
 
class  Engine
 The main class of the Leviathan Game Engine. More...
 
class  EntityState
 Holder of state for a whole entity. More...
 
class  Event
 Class that represents a statically defined event. More...
 
class  EventHandler
 Allows object to register for events that can be fired from anywhere. More...
 
class  Exception
 Base class for all exceptions thrown by Leviathan. More...
 
struct  FileDefinitionType
 
struct  FileDefSorter
 
class  FileSystem
 Class for indexing and searching game data directory. More...
 
class  FileTypeHolder
 File type. More...
 
struct  Float2
 
struct  Float3
 
struct  Float4
 
class  FpsCounter
 
class  GameConfiguration
 
class  GameModule
 Represents a scriptable part of a program. More...
 
class  GameModuleLoader
 Manages loading GameModule objects to make sure that each is loaded only once. More...
 
class  GameSpecificPacketData
 Class that contains all data associated with a game specific packet. More...
 
class  GameSpecificPacketHandler
 Handles construction of all game specific packets. More...
 
class  GameWorld
 Represents a world that contains entities. More...
 
class  GameWorldFactory
 Allows overwriting the used GameWorld class in the engine. By default creates a StandardWorld. More...
 
class  GenericEvent
 Class that represents a dynamically defined event. More...
 
class  GeometryHelpers
 Helpers for generating procedural geometry. More...
 
class  GlobalCEFHandler
 Singleton class for handling CEF initialization that needs to be done right away. More...
 
class  Graphics
 
struct  GUIOverlayInitializationData
 
class  GUIOverlayRenderer
 
class  IDFactory
 
class  InbuiltWorldFactory
 Factory for inbuilt world types. More...
 
class  InputController
 Manages registering multiple InputReceiver objects to a window to easily control where input is sent. More...
 
class  InputReceiver
 class to derive from when wanting to connect to input More...
 
class  InstanceCounter
 
struct  Int2
 
struct  Int3
 
class  IntegerEventData
 Data for EVENT_TYPE_ENGINE_TICK and all others that have only int data. More...
 
class  InvalidAccess
 
class  InvalidArgument
 
class  InvalidState
 
class  InvalidType
 
class  IteratorAssignmentData
 
class  IteratorCharacterData
 
class  IteratorFindUntilData
 
class  IteratorNestingLevelData
 
class  IteratorNumberFindData
 
class  IteratorPositionData
 
class  IteratorUntilSequenceData
 
class  JavaScriptHelper
 Class that collects various JavaScript functions that would bloat other parts. More...
 
class  Key
 
class  KeyConfiguration
 Holds key configuration for an application. More...
 
class  LambdaDelegateSlot
 
class  LeapListener
 
class  LeapManager
 
class  LeviathanApplication
 Base class for all leviathan programs. More...
 
class  LeviathanPhysicsOverlapFilter
 Handles AABB material callbacks. More...
 
class  Locker
 
struct  LockTypeResolver
 
struct  LockTypeResolver< Mutex >
 
struct  LockTypeResolver< RecursiveMutex >
 
class  Logger
 Logger class for all text output. More...
 
class  MasterServer
 
class  MasterServerApplication
 
struct  MasterServerInformation
 
class  MD5
 
class  Model
 Entity has a model. More...
 
class  ModelPropertiesSystem
 Handles properties of Model. More...
 
class  NamedVariableBlock
 DataBlock variant with name. More...
 
class  NamedVariableList
 hosts one or more VariableBlocks keeping only one name for all of them More...
 
class  NamedVars
 
class  NetworkAckField
 
class  NetworkCache
 Centralized variables that AI can use on clients to replicate server behavior. More...
 
class  NetworkClientInterface
 Class that encapsulates common networking functionality required by client programs. More...
 
class  NetworkHandler
 Handles everything related to connections. More...
 
class  NetworkInterface
 Class that encapsulates common networking functionality that is required by all networked programs. More...
 
class  NetworkMasterServerInterface
 Class that encapsulates common networking functionality required by server programs. More...
 
class  NetworkRequest
 
class  NetworkResponse
 
class  NetworkServerInterface
 Class that encapsulates common networking functionality required by server programs. More...
 
class  NonOwningScriptCallback
 A helper for keeping a weak reference to a script delegate or function. More...
 
class  NotFound
 
class  NULLPtr
 
class  ObjectFile
 
class  ObjectFileList
 Interface for object file lists to implement. More...
 
class  ObjectFileListProper
 Implementation of ObjectFileList. More...
 
class  ObjectFileObject
 Interface for object file objects to implement. More...
 
class  ObjectFileObjectProper
 Fully defined ObjectFileObject. More...
 
class  ObjectFileProcessor
 Static class for handling ObjectFiles. More...
 
class  ObjectFileTemplateDefinition
 Class that represents a template definition. More...
 
class  ObjectFileTemplateInstance
 Represents a template instantiation. More...
 
class  ObjectFileTemplateObject
 Class that represents an object created from a template. More...
 
class  ObjectFileTextBlock
 Interface for object file text blocks to implement. More...
 
class  ObjectFileTextBlockProper
 Implementation of ObjectFileTextBlock. More...
 
class  ObjectLoader
 Class to collect all entity creations to one class. More...
 
class  ObjectPool
 Creates objects in a shared memory region. More...
 
class  ObjectPoolTracked
 Creates objects in a shared memory region. More...
 
class  ObjectsComponentStates
 Holds state objects of type StateT related to a single entity. More...
 
class  OutOfMemoryHandler
 
class  PermissionsGroup
 
class  PermissionsManager
 
class  PermissionsNode
 
class  PermissionsPlayer
 
class  PerWorldData
 A base type for data classes that need to be associated with a GameWorld. More...
 
class  PhysicalMaterial
 
class  PhysicalWorld
 
class  Physics
 Entity has a physical component. More...
 
class  PhysicsBody
 This is an instance of a collision body. More...
 
class  PhysicsDataBridge
 This is an indirection helper for allowing world entities to detach from physics objects if they get destroyed. More...
 
class  PhysicsMaterialManager
 Contains a material list for applying automatic properties to PhysicsBody and collision callbacks. More...
 
class  PhysicsPositionProvider
 This acts as a bridge between Leviathan positions and physics engine positions. More...
 
class  PhysicsShape
 A physical shape that can be used to create PhysicsBody objects. More...
 
struct  PhysMaterialDataPair
 Defines properties between two materials. More...
 
class  Position
 Entity has position and direction it is looking at. More...
 
class  PositionStateSystem
 
struct  PotentiallySetIndex
 
class  QueuedTask
 Encapsulates a function that can later be ran in a free thread. More...
 
struct  QueuedTaskCheckValues
 Object passed to tasks which has common values. More...
 
class  Random
 Random number generator based on Mersenne Twister. More...
 
class  Received
 Entity is received from a server. More...
 
class  ReceivedSystem
 Interpolates states for received objects and handles locally controlled entities. More...
 
class  ReferenceCounted
 
class  RemoteConsole
 Class used to handle remote server commands and receiving messages. More...
 
class  RemoteConsoleSession
 
class  RenderingPositionSystem
 Moves nodes of entities that have their positions changed. More...
 
class  RenderingStatistics
 Mainly a FPS limiter. More...
 
class  RenderNode
 Entity has a scene node. More...
 
class  RenderNodePropertiesSystem
 Handles properties of scene objects that have a changed RenderNode. More...
 
class  RepeatCountedDelayedTask
 Encapsulates a function that is ran after a time period and repeated certain amount. More...
 
class  RepeatCountedTask
 Encapsulates a function that is ran certain amount of times. More...
 
class  RepeatingDelayedTask
 Encapsulates a function that is ran after a time period. More...
 
class  RequestCustom
 
class  RequestNone
 Empty request for ones that require no data. More...
 
class  ResourceFolderListener
 A file listener instance which listens for file changes in a folder. More...
 
class  ResourceRefreshHandler
 Allows various resource loaders to get notified when the file on disk changes. More...
 
class  ResponseCustom
 Used for BaseGameSpecificResponsePacket storing. More...
 
class  ResponseNone
 Empty keep alive response. More...
 
class  RotatingBufferHelper
 Helper for having a few BSF buffers for writing in turn. More...
 
class  ScopeTimer
 
class  ScriptArgumentsProvider
 Classes implementing this interface allow script modules to run automatic OnInit and OnRelease function during release. More...
 
class  ScriptArgumentsProviderBridge
 Forms a connection between a ScriptModule and a ScriptArgumentsProvider which either can disconnect. More...
 
class  ScriptComponentHolder
 
class  ScriptComponentState
 Class for supporting script defined component states. More...
 
class  ScriptConsole
 
class  ScriptExecutor
 Handles ScriptModule creation and AngelScript code execution. More...
 
class  ScriptLockHolder
 Allows scripts to create locks and easily convert them to LockPasser types. More...
 
class  ScriptLockPasser
 Class for Scripts to receive and pass on references to locks in native or script stacks. More...
 
class  ScriptModule
 
class  ScriptNotifiable
 BaseNotifiable for use in scripts. More...
 
class  ScriptNotifier
 BaseNotifier for use in scripts. More...
 
class  ScriptRunningSetup
 
struct  ScriptRunResult
 Holds a result of the new script run method. More...
 
struct  ScriptRunResult< void >
 
class  ScriptSafeVariableBlock
 Reference counted version for scripts of VariableBlock. More...
 
class  ScriptScript
 
struct  ScriptSourceFileData
 Represents a section of script source file. More...
 
struct  ScriptSystemUses
 Holds a single component type from c++ or from script, which a ScriptSystem uses. More...
 
class  ScriptSystemWrapper
 Wraps an AngelScript object that is an implementation of ScriptSystem. More...
 
class  Sendable
 Entity is sendable to clients. More...
 
class  SendableMarkFromSystem
 System type for marking Sendable as marked if a component of type T is marked. More...
 
class  SendableSystem
 Sends updated entities from server to clients. More...
 
struct  SentAcks
 Holds sent ack packets in order to mark the acks as properly sent. More...
 
class  SentNetworkThing
 Represents a sent packet and holds all kinds of data for it. More...
 
class  SentRequest
 Stores Requests while they are waiting for a response. More...
 
class  SentResponse
 Stores Responses that want confirmation that they have arrived. More...
 
class  ServerApplication
 
struct  SimpleAnimation
 Contains an animation for Animated component. More...
 
class  SingleSystem
 Base class for systems that use a single component directly. More...
 
class  SoundDevice
 Manages loading the audio library and provides some helpers. More...
 
struct  StartEndIndex
 
class  StateCreationSystem
 Base class for all systems that create states from changed components. More...
 
class  StateHolder
 Holds state objects of type for quick access by ObjectID. More...
 
class  StateInterpolator
 
class  StringClassDataIterator
 Iterator for string types. More...
 
class  StringClassPointerIterator
 Iterator that doesn't hold own copy of a string. More...
 
class  StringDataIterator
 
class  StringIterator
 Iterator class for getting parts of a string. More...
 
class  StringOperations
 Singleton class that has string processing functions. More...
 
class  SyncedPrimitive
 Template class for syncing basic types. More...
 
class  SyncedResource
 Base class for all values that are to be automatically synced between clients. More...
 
class  SyncedValue
 Class that encapsulates a value that can be used for syncing. More...
 
class  SyncedVariables
 Class that synchronizes some key variables with another instance. More...
 
class  System
 Base for all entity component related systems. More...
 
class  SystemCachedComponentCollectionStorage
 
class  TaskThread
 Object used by ThreadingManager to easily create properly initialized threads. More...
 
class  TextureGenerator
 
class  ThisPointerTypeChecker
 This can check the "this" pointer that the class' constructor was called on it. More...
 
class  ThreadingManager
 Manages delayed execution of functions through use of QueuedTask and subclasses. More...
 
class  ThreadSafeGeneric
 Allows the inherited object to be locked. More...
 
class  ThreadSafeObjectPool
 Thread safe version of ObjectPool. More...
 
struct  ThreadSpecificData
 
class  Time
 
class  TimingMonitor
 
struct  TimingMonitorClock
 
struct  TvalToTypeResolver
 
struct  TypeToAngelScriptIDConverter
 
struct  TypeToAngelScriptTypeString
 Converts type to AngelScript type string. More...
 
class  UTF8DataIterator
 Unicode iterator for utf8 on top of string. More...
 
class  UTF8PointerDataIterator
 Raw pointer utf8 iterator. More...
 
struct  ValidListenerData
 some data that is stored when a listener is found More...
 
class  VariableBlock
 Non-template class for working with all types of DataBlocks. More...
 
class  Visitable
 Base class for all classes that accept visitors. More...
 
class  Visitor
 Base for all different visitors. More...
 
class  Window
 
struct  WindowDataDetails
 
class  WireData
 
struct  WorldNetworkSettings
 

Typedefs

typedef DataBlock< int > IntBlock
 
typedef DataBlock< float > FloatBlock
 
typedef DataBlock< bool > BoolBlock
 
typedef DataBlock< std::wstring > WstringBlock
 
typedef DataBlock< std::string > StringBlock
 
typedef DataBlock< char > CharBlock
 
typedef DataBlock< double > DoubleBlock
 
typedef DataBlock< void * > VoidPtrBlock
 
using Mutex = std::mutex
 
using RecursiveMutex = std::recursive_mutex
 
using Lock = std::unique_lock< std::mutex >
 
using RecursiveLock = std::lock_guard< std::recursive_mutex >
 
using ThreadSafe = ThreadSafeGeneric< Mutex >
 Simple lockable objects, no recursive locking. More...
 
using ThreadSafeRecursive = ThreadSafeGeneric< RecursiveMutex >
 Object supports recursive locking. More...
 
using ObjectID = int32_t
 
typedef Key< int32_t > GKey
 
using PhysicsMaterialAABBCallback = bool(*)(PhysicalWorld &world, PhysicsBody &, PhysicsBody &)
 
using PhysicsMaterialContactCallback = void(*)(PhysicalWorld &world, PhysicsBody &, PhysicsBody &)
 
using AccessFlags = uint32_t
 

Enumerations

enum  COMPONENT_TYPE : uint16_t {
  COMPONENT_TYPE::Position, COMPONENT_TYPE::RenderNode, COMPONENT_TYPE::Sendable, COMPONENT_TYPE::Received,
  COMPONENT_TYPE::Physics, COMPONENT_TYPE::BoxGeometry, COMPONENT_TYPE::Model, COMPONENT_TYPE::Camera,
  COMPONENT_TYPE::Animated, COMPONENT_TYPE::Custom = 10000
}
 Must contain all valid Component types. More...
 
enum  INBUILT_WORLD_TYPE : int32_t { INBUILT_WORLD_TYPE::Standard = 1024 }
 Types of inbuilt world types. More...
 
enum  EVENT_TYPE {
  EVENT_TYPE_ERROR = 0, EVENT_TYPE_WAKEUP, EVENT_TYPE_GENERAL, EVENT_TYPE_KEYPRESS,
  EVENT_TYPE_KEYDOWN, EVENT_TYPE_SHOW, EVENT_TYPE_HIDE, EVENT_TYPE_TICK,
  EVENT_TYPE_REMOVE, EVENT_TYPE_EVENT_SEQUENCE_BEGIN, EVENT_TYPE_EVENT_SEQUENCE_END, EVENT_TYPE_MOUSEMOVED,
  EVENT_TYPE_MOUSEPOSITION, EVENT_TYPE_GUIDISABLE, EVENT_TYPE_GUIENABLE, EVENT_TYPE_RESIZE,
  EVENT_TYPE_WINDOW_RESIZE, EVENT_TYPE_ONCLICK, EVENT_TYPE_LISTENERVALUEUPDATED, EVENT_TYPE_FRAME_BEGIN,
  EVENT_TYPE_FRAME_END, EVENT_TYPE_INIT, EVENT_TYPE_RELEASE, EVENT_TYPE_TEST,
  EVENT_TYPE_CLIENT_INTERPOLATION, EVENT_TYPE_ALL
}
 Engine events that are triggered at certain times. More...
 
enum  FILEGROUP {
  FILEGROUP_MODEL, FILEGROUP_TEXTURE, FILEGROUP_SOUND, FILEGROUP_SCRIPT,
  FILEGROUP_OTHER
}
 
enum  COMMANDSENDER_PERMISSIONMODE { COMMANDSENDER_PERMISSIONMODE_NORMAL, COMMANDSENDER_PERMISSIONMODE_IGNORE }
 
enum  QUOTETYPE { QUOTETYPE_DOUBLEQUOTES, QUOTETYPE_SINGLEQUOTES, QUOTETYPE_BOTH }
 
enum  DECIMALSEPARATORTYPE { DECIMALSEPARATORTYPE_DOT, DECIMALSEPARATORTYPE_COMMA, DECIMALSEPARATORTYPE_BOTH, DECIMALSEPARATORTYPE_NONE }
 
enum  UNNORMALCHARACTER {
  UNNORMALCHARACTER_TYPE_NON_ASCII = 0x1, UNNORMALCHARACTER_TYPE_CONTROLCHARACTERS = 0x2, UNNORMALCHARACTER_TYPE_WHITESPACE = 0x4, UNNORMALCHARACTER_TYPE_LOWCODES = 0x8,
  UNNORMALCHARACTER_TYPE_NON_NAMEVALID = 0x10, UNNORMALCHARACTER_TYPE_LINEEND = 0x20
}
 
enum  EQUALITYCHARACTER { EQUALITYCHARACTER_TYPE_EQUALITY, EQUALITYCHARACTER_TYPE_DOUBLEDOTSTYLE, EQUALITYCHARACTER_TYPE_ALL }
 
enum  ITERATORCALLBACK_RETURNTYPE { ITERATORCALLBACK_RETURNTYPE_STOP, ITERATORCALLBACK_RETURNTYPE_CONTINUE }
 
enum  SPECIAL_ITERATOR { SPECIAL_ITERATOR_ONNEWLINE_STOP = 0x4, SPECIAL_ITERATOR_HANDLECOMMENTS_ASSTRING = 0x10 }
 Special case handling flags for iterator. More...
 
enum  ITERATORFLAG_SET {
  ITERATORFLAG_SET_IGNORE_SPECIAL = 0x1, ITERATORFLAG_SET_STOP = 0x2, ITERATORFLAG_SET_INSIDE_STRING = 0x4, ITERATORFLAG_SET_INSIDE_STRING_DOUBLE = 0x8,
  ITERATORFLAG_SET_INSIDE_STRING_SINGLE = 0x10, ITERATORFLAG_SET_INSIDE_STRING_SINGLE_END = 0x20, ITERATORFLAG_SET_INSIDE_STRING_DOUBLE_END = 0x40, ITERATORFLAG_SET_IGNORE_SPECIAL_END = 0x80,
  ITERATORFLAG_SET_COMMENT_BEGINNING = 0x100, ITERATORFLAG_SET_INSIDE_COMMENT = 0x200, ITERATORFLAG_SET_INSIDE_CPPCOMMENT = 0x400, ITERATORFLAG_SET_INSIDE_CCOMMENT = 0x800,
  ITERATORFLAG_SET_CPPCOMMENT_END = 0x1000, ITERATORFLAG_SET_CCOMMENT_END = 0x2000
}
 Set flags for the iterator, this is changed to this for performance. More...
 
enum  NETWORKED_TYPE { NETWORKED_TYPE::Client, NETWORKED_TYPE::Server, NETWORKED_TYPE::Master, NETWORKED_TYPE::Error }
 Type of networked application. More...
 
enum  PACKET_TIMEOUT_STYLE : uint8_t { PACKET_TIMEOUT_STYLE::Unified }
 
enum  RECEIVE_GUARANTEE { RECEIVE_GUARANTEE::None, RECEIVE_GUARANTEE::ResendOnce, RECEIVE_GUARANTEE::Critical }
 Controls whether a packet is critical. More...
 
enum  CONNECTION_ENCRYPTION { CONNECTION_ENCRYPTION::Undecided, CONNECTION_ENCRYPTION::None, CONNECTION_ENCRYPTION::Standard }
 State of a connection's encryption. More...
 
enum  SERVER_JOIN_RESTRICT : uint8_t {
  SERVER_JOIN_RESTRICT::None, SERVER_JOIN_RESTRICT::Localhost, SERVER_JOIN_RESTRICT::LAN, SERVER_JOIN_RESTRICT::Whitelist,
  SERVER_JOIN_RESTRICT::Invite, SERVER_JOIN_RESTRICT::Friends, SERVER_JOIN_RESTRICT::Permissions, SERVER_JOIN_RESTRICT::Custom
}
 Allows servers to control who can join. More...
 
enum  SERVER_STATUS : uint8_t { SERVER_STATUS::Starting, SERVER_STATUS::Running, SERVER_STATUS::Shutdown, SERVER_STATUS::Restart }
 Allows servers to tell clients what they are doing. More...
 
enum  NETWORK_RESPONSE_INVALIDREASON : uint8_t {
  NETWORK_RESPONSE_INVALIDREASON::Unauthenticated, NETWORK_RESPONSE_INVALIDREASON::Unsupported, NETWORK_RESPONSE_INVALIDREASON::ServerFull, NETWORK_RESPONSE_INVALIDREASON::ServerNotAcceptingPlayers,
  NETWORK_RESPONSE_INVALIDREASON::NotAuthorized, NETWORK_RESPONSE_INVALIDREASON::ServerAlreadyConnectedToYou, NETWORK_RESPONSE_INVALIDREASON::InvalidParameters, NETWORK_RESPONSE_INVALIDREASON::ServerCustom
}
 Defines in what way a request was invalid can also define why a server disallowed a request. More...
 
enum  SERVER_ACCEPTED_TYPE : uint8_t { SERVER_ACCEPTED_TYPE::ConnectAccepted, SERVER_ACCEPTED_TYPE::RequestQueued, SERVER_ACCEPTED_TYPE::Done }
 Defines what request the server accepted and any potential data. More...
 
enum  PING_FAIL_REASON { PING_FAIL_REASON::LossTooHigh, PING_FAIL_REASON::ConnectionClosed }
 If true 2 ack only packets are created each time one is sent. More...
 
enum  CONNECTION_RESTRICTION { CONNECTION_RESTRICTION::None, CONNECTION_RESTRICTION::ReceiveRemoteConsole }
 Allows restricting connections to allow only certain packets. More...
 
enum  CONNECTION_STATE {
  CONNECTION_STATE::NothingReceived, CONNECTION_STATE::Initial, CONNECTION_STATE::Connected, CONNECTION_STATE::Secured,
  CONNECTION_STATE::Authenticated, CONNECTION_STATE::Closed, CONNECTION_STATE::Punchthrough
}
 Main state of a connection. More...
 
enum  RECEIVED_STATE { RECEIVED_STATE::NotReceived = 0, RECEIVED_STATE::StateReceived, RECEIVED_STATE::AcksSent, RECEIVED_STATE::ReceivedAckSucceeded }
 For keeping track of received remote packets. More...
 
enum  NETWORK_REQUEST_TYPE : uint16_t {
  NETWORK_REQUEST_TYPE::Connect, NETWORK_REQUEST_TYPE::Security, NETWORK_REQUEST_TYPE::Authenticate, NETWORK_REQUEST_TYPE::Identification,
  NETWORK_REQUEST_TYPE::Serverstatus, NETWORK_REQUEST_TYPE::RemoteConsoleOpen, NETWORK_REQUEST_TYPE::RemoteConsoleAccess, NETWORK_REQUEST_TYPE::CloseRemoteConsole,
  NETWORK_REQUEST_TYPE::DoRemoteConsoleOpen, NETWORK_REQUEST_TYPE::JoinServer, NETWORK_REQUEST_TYPE::JoinGame, NETWORK_REQUEST_TYPE::GetSingleSyncValue,
  NETWORK_REQUEST_TYPE::GetAllSyncValues, NETWORK_REQUEST_TYPE::RequestCommandExecution, NETWORK_REQUEST_TYPE::ConnectInput, NETWORK_REQUEST_TYPE::Echo,
  NETWORK_REQUEST_TYPE::WorldClockSync, NETWORK_REQUEST_TYPE::Custom
}
 
enum  NETWORK_RESPONSE_TYPE : uint16_t {
  NETWORK_RESPONSE_TYPE::Connect, NETWORK_RESPONSE_TYPE::Security, NETWORK_RESPONSE_TYPE::Authenticate, NETWORK_RESPONSE_TYPE::Identification,
  NETWORK_RESPONSE_TYPE::Keepalive, NETWORK_RESPONSE_TYPE::CloseConnection, NETWORK_RESPONSE_TYPE::RemoteConsoleClosed, NETWORK_RESPONSE_TYPE::RemoteConsoleOpened,
  NETWORK_RESPONSE_TYPE::InvalidRequest, NETWORK_RESPONSE_TYPE::ServerDisallow, NETWORK_RESPONSE_TYPE::ServerAllow, NETWORK_RESPONSE_TYPE::ServerStatus,
  NETWORK_RESPONSE_TYPE::SyncValData, NETWORK_RESPONSE_TYPE::SyncDataEnd, NETWORK_RESPONSE_TYPE::SyncResourceData, NETWORK_RESPONSE_TYPE::CreateNetworkedInput,
  NETWORK_RESPONSE_TYPE::UpdateNetworkedInput, NETWORK_RESPONSE_TYPE::DisconnectInput, NETWORK_RESPONSE_TYPE::StartWorldReceive, NETWORK_RESPONSE_TYPE::EntityCreation,
  NETWORK_RESPONSE_TYPE::EntityUpdate, NETWORK_RESPONSE_TYPE::EntityDestruction, NETWORK_RESPONSE_TYPE::EntityLocalControlStatus, NETWORK_RESPONSE_TYPE::CacheUpdated,
  NETWORK_RESPONSE_TYPE::CacheRemoved, NETWORK_RESPONSE_TYPE::WorldFrozen, NETWORK_RESPONSE_TYPE::ServerHeartbeat, NETWORK_RESPONSE_TYPE::StartHeartbeats,
  NETWORK_RESPONSE_TYPE::None, NETWORK_RESPONSE_TYPE::Custom
}
 Defines the type of response that the packet contains. More...
 
enum  ScriptAccess : uint32_t { ScriptAccess::Nothing = 0x0, ScriptAccess::Builtin = 0x1, ScriptAccess::DefaultEngine = 0x2, ScriptAccess::FullFileSystem = 0x4 }
 
enum  CONSOLECOMMANDRESULTSTATE { CONSOLECOMMANDRESULTSTATE_SUCCEEDED, CONSOLECOMMANDRESULTSTATE_FAILED, CONSOLECOMMANDRESULTSTATE_WAITINGFORMORE }
 
enum  CONSOLECOMMANDTYPE {
  CONSOLECOMMANDTYPE_NONE, CONSOLECOMMANDTYPE_ADDVAR, CONSOLECOMMANDTYPE_ADDFUNC, CONSOLECOMMANDTYPE_DELVAR,
  CONSOLECOMMANDTYPE_DELFUNC, CONSOLECOMMANDTYPE_PRINTVAR, CONSOLECOMMANDTYPE_PRINTFUNC, CONSOLECOMMANDTYPE_ERROR
}
 
enum  SCRIPTBUILDSTATE {
  SCRIPTBUILDSTATE_EMPTY, SCRIPTBUILDSTATE_READYTOBUILD, SCRIPTBUILDSTATE_BUILT, SCRIPTBUILDSTATE_FAILED,
  SCRIPTBUILDSTATE_DISCARDED
}
 
enum  SCRIPT_RUNTYPE { SCRIPT_RUNTYPE_BREAKONERROR, SCRIPT_RUNTYPE_TRYTOCONTINUE }
 
enum  SCRIPT_RUN_RESULT { SCRIPT_RUN_RESULT::Success, SCRIPT_RUN_RESULT::Error, SCRIPT_RUN_RESULT::Suspended }
 

Functions

 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (IntBlock, int, int)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (FloatBlock, float, float)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (BoolBlock, bool, bool)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (WstringBlock, wstring, wstring)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (StringBlock, string, string)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (DoubleBlock, double, double)
 
 DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (CharBlock, char, sf::Int8)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const VariableBlock &value)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (int, DATABLOCK_TYPE_INT)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (float, DATABLOCK_TYPE_FLOAT)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (bool, DATABLOCK_TYPE_BOOL)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (std::wstring, DATABLOCK_TYPE_WSTRING)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (std::string, DATABLOCK_TYPE_STRING)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (char, DATABLOCK_TYPE_CHAR)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (double, DATABLOCK_TYPE_DOUBLE)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (void *, DATABLOCK_TYPE_VOIDPTR)
 
 NAMERESOLVERTEMPLATEINSTANTIATION (void, DATABLOCK_TYPE_VOIDPTR)
 
 TVALRESOLVERTYPE (IntBlock, DATABLOCK_TYPE_INT)
 
 TVALRESOLVERTYPE (FloatBlock, DATABLOCK_TYPE_FLOAT)
 
 TVALRESOLVERTYPE (BoolBlock, DATABLOCK_TYPE_BOOL)
 
 TVALRESOLVERTYPE (WstringBlock, DATABLOCK_TYPE_WSTRING)
 
 TVALRESOLVERTYPE (StringBlock, DATABLOCK_TYPE_STRING)
 
 TVALRESOLVERTYPE (CharBlock, DATABLOCK_TYPE_CHAR)
 
 TVALRESOLVERTYPE (DoubleBlock, DATABLOCK_TYPE_DOUBLE)
 
 TVALRESOLVERTYPE (VoidPtrBlock, DATABLOCK_TYPE_VOIDPTR)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, int,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, float,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (BoolBlock, bool,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, char,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, double)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, double,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, bool,(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, int)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, char)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, float)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::wstring,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::string, Convert::Utf16ToUtf8(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, bool, Convert::WstringFromBoolToInt(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, float, Convert::WstringTo< float >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, double, Convert::WstringTo< double >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, char,(char) Convert::WstringTo< wchar_t >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, int, Convert::WstringTo< int >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::string,(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::wstring, Convert::Utf8ToUtf16(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, bool, Convert::StringFromBoolToInt(*block->Value) !=0)
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, float, Convert::StringTo< float >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, double, Convert::StringTo< double >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, char, Convert::StringTo< char >(*block->Value))
 
 CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, int, Convert::StringTo< int >(*block->Value))
 
template<class InputIteratorT , class ResultInserterT >
void FindRemovedElements (const InputIteratorT &oldbegin, const InputIteratorT &oldend, const InputIteratorT &newbegin, const InputIteratorT &newend, ResultInserterT &addedresult, ResultInserterT &removedresult)
 
template<class InputCollectionT , class ResultInserterT >
void FindRemovedElements (const InputCollectionT &olditems, const InputCollectionT &newitems, ResultInserterT &addedresult, ResultInserterT &removedresult)
 
DLLEXPORT std::string_view GetMimeTypeFromPath (const std::string_view &path)
 This returns a mime type based on the file extension. More...
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float2 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float2 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float3 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float3 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const Float4 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, Float4 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const NamedVariableList &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, const NamedVariableList &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const sf::Packet &packetinner)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, sf::Packet &packetinner)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const bs::Vector3 &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, bs::Vector3 &data)
 
DLLEXPORT sf::Packet & operator<< (sf::Packet &packet, const bs::Plane &data)
 
DLLEXPORT sf::Packet & operator>> (sf::Packet &packet, bs::Plane &data)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Float4 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Float3 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const Leviathan::Float2 &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const PotentiallySetIndex &value)
 
DLLEXPORT std::ostream & operator<< (std::ostream &stream, const StartEndIndex &value)
 
DLLEXPORT void ScriptSystemNodeHelper (GameWorld *world, void *cachedcomponents, int cachedtypeid, CScriptArray &systemcomponents)
 Helper for script systems to call to properly handle added and removed nodes. More...
 
DLLEXPORT void JSArrayToList (const CefRefPtr< CefV8Value > &source, const CefRefPtr< CefListValue > &target)
 Converts a JS array to list value. More...
 
DLLEXPORT void JSObjectToDictionary (const CefRefPtr< CefV8Value > &source, const CefRefPtr< CefDictionaryValue > &target)
 Takes a JS object and makes it into a dictionary for sending between processes. More...
 
template<class SourceT , class KeyT >
std::unique_ptr< DataBlockAllHandleSimpleVar (CefValueType type, const CefRefPtr< SourceT > &source, const KeyT &key)
 
DLLEXPORT void CEFDictionaryToNamedVars (const CefRefPtr< CefDictionaryValue > &source, NamedVars &destination)
 Converts CEF dictionary to NamedVars. More...
 
void FFMPEGCallback (void *ptr, int level, const char *fmt, va_list varg)
 Custom callback for ffmpeg to pipe output to our logger class. More...
 
template<typename KeyType >
bool MatchesAnyKeyInSet (const std::vector< Key< KeyType >> keys, const KeyType &chara, const short &additional, bool strict=false)
 Helper for checking multiple keys. More...
 
void RunGetResponseFromMaster (NetworkHandler *instance, std::shared_ptr< std::promise< std::string >> resultvar)
 
bool operator== (const ScriptAccess &lhs, const AccessFlags &rhs)
 
bool operator== (const AccessFlags &lhs, const ScriptAccess &rhs)
 
DLLEXPORT AccessFlags ParseScriptAccess (std::string_view flagstring)
 Parses a string for access flags. More...
 
DLLEXPORT AccessFlags StringToScriptAccess (std::string_view str)
 Returns ScriptAccess matching string. More...
 
template<class From , class To >
To * DoReferenceCastDynamic (From *ptr)
 
template<class From , class To >
To * DoReferenceCastStatic (From *ptr)
 
template<class From , class To >
To * DoReferenceCastDynamicNoRef (From *ptr)
 
template<class From , class To >
To * DoReferenceCastStaticNoRef (From *ptr)
 
bool BindMathOperations (asIScriptEngine *engine)
 
bool BindStandardFunctions (asIScriptEngine *engine)
 Binds standard and other utilities like: std::min, std::max etc. More...
 
template<class HandleT , class HeldT >
bool RegisterBSFShandleType (const char *type, asIScriptEngine *engine)
 
bool BindBSFTypeDefs (asIScriptEngine *engine)
 
bool BindVector3 (asIScriptEngine *engine)
 
bool BindVector4 (asIScriptEngine *engine)
 
bool BindColour (asIScriptEngine *engine)
 
bool BindMatrix4 (asIScriptEngine *engine)
 
bool BindAnglesAndQuaternion (asIScriptEngine *engine)
 
bool BindPlane (asIScriptEngine *engine)
 
bool BindRay (asIScriptEngine *engine)
 
bool BindScene (asIScriptEngine *engine)
 
bool BindTextures (asIScriptEngine *engine)
 
bool BindMaterials (asIScriptEngine *engine)
 
bool BindMeshes (asIScriptEngine *engine)
 
bool BindBSF (asIScriptEngine *engine)
 
bool BindDataBlock (asIScriptEngine *engine)
 
bool BindNamedVars (asIScriptEngine *engine)
 
bool BindEvents (asIScriptEngine *engine)
 
bool BindRandom (asIScriptEngine *engine)
 
bool BindThreadingManager (asIScriptEngine *engine)
 
bool BindWindow (asIScriptEngine *engine)
 
bool BindGraphics (asIScriptEngine *engine)
 
bool BindEngine (asIScriptEngine *engine)
 
bool BindApplication (asIScriptEngine *engine)
 
bool BindGameModule (asIScriptEngine *engine)
 
bool BindDelegates (asIScriptEngine *engine)
 
bool BindAudioSource (asIScriptEngine *engine)
 
bool BindSound (asIScriptEngine *engine)
 
bool BindFileSystem (asIScriptEngine *engine)
 
bool BindEngineCommon (asIScriptEngine *engine)
 
bool BindRayCast (asIScriptEngine *engine)
 
bool BindComponentTypeID (asIScriptEngine *engine, const char *name, uint16_t *value)
 Helper for BindComponentTypes. More...
 
bool BindComponentTypes (asIScriptEngine *engine)
 
bool BindScriptComponentTypeSupport (asIScriptEngine *engine)
 
bool BindEntity (asIScriptEngine *engine)
 
bool BindGUI (asIScriptEngine *engine)
 
bool BindShape (asIScriptEngine *engine)
 
bool BindBody (asIScriptEngine *engine)
 
bool BindPhysics (asIScriptEngine *engine)
 
template<class WorldType >
bool BindGameWorldBaseMethods (asIScriptEngine *engine, const char *classname)
 
template<class WorldType >
bool BindStandardWorldMethods (asIScriptEngine *engine, const char *classname)
 
bool BindFloat2 (asIScriptEngine *engine)
 
bool BindFloat3 (asIScriptEngine *engine)
 
bool BindFloat4 (asIScriptEngine *engine)
 
bool BindInt2 (asIScriptEngine *engine)
 
bool BindInt3 (asIScriptEngine *engine)
 
bool BindBSFConversions (asIScriptEngine *engine)
 
bool BindTypeDefs (asIScriptEngine *engine)
 
bool BindTypes (asIScriptEngine *engine)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, uint32_t value)
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, void *value, int valuetypeid)
 Passes an object type that has already been resolved. More...
 
bool PassParameterToCustomRun (std::unique_ptr< CustomScriptRun > &run, asIScriptObject *value)
 Passes a script object type. More...
 
template<class T >
static constexpr bool IsTypeReferenceCounted ()
 Returns true of object type is reference counted. More...
 
template<class T >
static void IncrementRefCountIfRefCountedType (T *current)
 Increments refcount of obj if it is derived from ReferenceCounted or an angelscript type. More...
 
template<class T >
static void DecrementRefCountIfRefCountedType (T *current)
 Increments refcount of obj if it is derived from ReferenceCounted or an angelscript type. More...
 
template<class T >
static constexpr bool CanTypeRepresentAngelScriptTypes ()
 Returns true if type is an angelscript type that can represent different types of objects. More...
 
template<class T >
CScriptArray * ConvertVectorToASArray (const std::vector< T > &data, asIScriptEngine *engine, const char *arraytype=nullptr)
 Converts a std::vector to an AngelScript array. More...
 
template<class T >
CScriptArray * ConvertIteratorToASArray (T begin, T end, asIScriptEngine *engine, const char *arraytype=nullptr)
 Variant that converts from iterator range to an AngelScript array. More...
 
void ScriptMessageCallback (const asSMessageInfo *msg, void *param)
 
asIScriptContext * RequestContextCallback (asIScriptEngine *engine, void *userdata)
 
void ReturnContextCallback (asIScriptEngine *engine, asIScriptContext *context, void *userdata)
 
bool RegisterNotifiersWithAngelScript (asIScriptEngine *engine)
 
DLLEXPORT int ResolveProxy (const char *type, ScriptExecutor *resolver, bool constversion)
 
DLLEXPORT ScriptExecutorGetCurrentGlobalScriptExecutor ()
 Proxy for stuff that wants to only include this file. More...
 
 TYPE_RESOLVER_AS_PREDEFINED (int, "int")
 
 TYPE_RESOLVER_AS_PREDEFINED (unsigned int, "uint")
 
 TYPE_RESOLVER_AS_PREDEFINED (int64_t, "int64")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint64_t, "uint64")
 
 TYPE_RESOLVER_AS_PREDEFINED (int16_t, "int16")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint16_t, "uint16")
 
 TYPE_RESOLVER_AS_PREDEFINED (int8_t, "int8")
 
 TYPE_RESOLVER_AS_PREDEFINED (uint8_t, "uint8")
 
 TYPE_RESOLVER_AS_PREDEFINED (double, "double")
 
 TYPE_RESOLVER_AS_PREDEFINED (float, "float")
 
 TYPE_RESOLVER_AS_PREDEFINED (bool, "bool")
 
 TYPE_RESOLVER_AS_PREDEFINED (char, "int8")
 
 TYPE_RESOLVER_AS_PREDEFINED (std::string, "string")
 
 TYPE_RESOLVER_AS_PREDEFINED (bs::Color, "bs::Color@")
 
 TYPE_RESOLVER_AS_PREDEFINED (bs::Matrix4, "bs::Matrix4@")
 
 TYPE_RESOLVER_AS_PREDEFINED (NewtonCollision, "NewtonCollision@")
 
void RunNewThread (TaskThread *thisthread)
 
DLLEXPORT void RegisterOgreOnThread ()
 
DLLEXPORT void UnregisterOgreOnThread ()
 
void RunTaskQueuerThread (ThreadingManager *manager)
 
void SetThreadName (TaskThread *thread, const std::string &name)
 

Variables

constexpr int32_t DOT_CHARACTER = '.'
 
constexpr int32_t UNIVERSAL_PATHSEPARATOR = '/'
 
constexpr int32_t WINDOWS_PATHSEPARATOR = '\\'
 
constexpr int32_t SPACE_CHARACTER = ' '
 
constexpr int32_t FIRST_NUMBER = '0'
 
constexpr int32_t LAST_NUMBER = '9'
 
constexpr int32_t DASH_CHARACTER = '-'
 
constexpr int32_t PLUS_SYMBOL = '+'
 
constexpr char WINDOWS_LINE_SEPARATOR [] = "\r\n"
 
constexpr char UNIVERSAL_LINE_SEPARATOR [] = "\n"
 
constexpr auto TICKSPEED = 50
 Number of milliseconds between engine and world ticks. More...
 
constexpr auto INTERPOLATION_TIME = 100
 
constexpr auto HEARTBEATS_MILLISECOND = 180
 
constexpr auto DEFAULT_MAXCONNECT_TRIES = 5
 
constexpr auto MAX_SERVERCOMMAND_LENGTH = 550
 
constexpr auto BASESENDABLE_STORED_RECEIVED_STATES = 6
 
constexpr auto PACKET_LOST_AFTER_MILLISECONDS = 1000
 
constexpr auto PACKET_LOST_AFTER_RECEIVED_NEWER = 4
 
constexpr auto CRITICAL_PACKET_MAX_TRIES = 8
 
constexpr float NORMALIZATION_TOLERANCE = 1e-6f
 For checking vector normalization. More...
 
constexpr auto MICROSECONDS_IN_SECOND = 1000000
 
constexpr float PI = 3.14159265f
 
constexpr float DEGREES_TO_RADIANS = PI / 180.f
 
constexpr float RADIANS_TO_DEGREES = 180.f / PI
 
constexpr float EPSILON = 0.00000001f
 
constexpr ObjectID NULL_OBJECT = 0
 
constexpr auto KEPT_STATES_COUNT = 5
 Number of states that are kept. Corresponds to time span of TICKSPEED * KEPT_STATES_COUNT. More...
 
static const std::map< std::string, EVENT_TYPEEventListenerNameToEventMap
 
static const std::map< std::string, EVENT_TYPEEventListenerCommonNameToEventMap
 
static std::string FFMPEGOutBuffer = ""
 This is for storing the ffmpeg output lines until a full line is outputted. More...
 
static Mutex FFMPEGOutBufferMutex
 
constexpr uint16_t LEVIATHAN_NORMAL_PACKET = 0x4C6E
 
constexpr uint16_t LEVIATHAN_ACK_PACKET = 0x4C61
 
constexpr uint8_t NORMAL_RESPONSE_TYPE = 0x12
 
constexpr uint8_t NORMAL_REQUEST_TYPE = 0x28
 
constexpr auto PHYSICS_BASE_GRAVITY = -9.81f
 
constexpr AccessFlags DefaultAccessFlags
 
static uint16_t PhysicsTYPEProxy = static_cast<uint16_t>(Physics::TYPE)
 
static uint16_t PositionTYPEProxy = static_cast<uint16_t>(Position::TYPE)
 
static uint16_t RenderNodeTYPEProxy = static_cast<uint16_t>(RenderNode::TYPE)
 
static uint16_t SendableTYPEProxy = static_cast<uint16_t>(Sendable::TYPE)
 
static uint16_t ReceivedTYPEProxy = static_cast<uint16_t>(Received::TYPE)
 
static uint16_t ModelTYPEProxy = static_cast<uint16_t>(Model::TYPE)
 
static uint16_t BoxGeometryTYPEProxy = static_cast<uint16_t>(BoxGeometry::TYPE)
 
static uint16_t CameraTYPEProxy = static_cast<uint16_t>(Camera::TYPE)
 
static uint16_t AnimatedTYPEProxy = static_cast<uint16_t>(Animated::TYPE)
 
constexpr auto ANGELSCRIPT_VOID_TYPEID = 0
 This has to be constant (and luckily so far it has been) More...
 

Detailed Description

The access mask controls which registered functions and classes a script sees.

Typedef Documentation

◆ AccessFlags

using Leviathan::AccessFlags = typedef uint32_t

Definition at line 54 of file AccessMask.h.

◆ BoolBlock

Definition at line 384 of file DataBlock.h.

◆ CharBlock

Definition at line 387 of file DataBlock.h.

◆ DoubleBlock

Definition at line 388 of file DataBlock.h.

◆ FloatBlock

Definition at line 383 of file DataBlock.h.

◆ GKey

typedef Key<int32_t> Leviathan::GKey

Definition at line 260 of file Key.h.

◆ IntBlock

Definition at line 382 of file DataBlock.h.

◆ Lock

using Leviathan::Lock = typedef std::unique_lock<std::mutex>

Definition at line 18 of file ThreadSafe.h.

◆ Mutex

using Leviathan::Mutex = typedef std::mutex

Definition at line 16 of file ThreadSafe.h.

◆ ObjectID

using Leviathan::ObjectID = typedef int32_t

Definition at line 11 of file EntityCommon.h.

◆ PhysicsMaterialAABBCallback

This callback is called first when the bounding boxes of 2 bodies touch. This can be used then to disable the collision or allow the collision. After this has run if the bodies actually hit each other PhysicsMaterialContactCallback will be called once for each touching point. If no fine grained hit detection is needed this can also be used for that. Returning false disables the collision between the objects. Returning true enables the collision

Definition at line 22 of file PhysicalMaterial.h.

◆ PhysicsMaterialContactCallback

This function is called every time an actual collision occurs between objects for each collision point between the materials. This is recommended to be used for playing sound effects and other fine grained hit detection.

Definition at line 30 of file PhysicalMaterial.h.

◆ RecursiveLock

using Leviathan::RecursiveLock = typedef std::lock_guard<std::recursive_mutex>

Definition at line 19 of file ThreadSafe.h.

◆ RecursiveMutex

using Leviathan::RecursiveMutex = typedef std::recursive_mutex

Definition at line 17 of file ThreadSafe.h.

◆ StringBlock

typedef DataBlock<std::string> Leviathan::StringBlock

Definition at line 386 of file DataBlock.h.

◆ ThreadSafe

Simple lockable objects, no recursive locking.

Definition at line 164 of file ThreadSafe.h.

◆ ThreadSafeRecursive

Object supports recursive locking.

Less efficient than ThreadSafe

Definition at line 169 of file ThreadSafe.h.

◆ VoidPtrBlock

Definition at line 389 of file DataBlock.h.

◆ WstringBlock

typedef DataBlock<std::wstring> Leviathan::WstringBlock

Definition at line 385 of file DataBlock.h.

Enumeration Type Documentation

◆ COMMANDSENDER_PERMISSIONMODE

Enumerator
COMMANDSENDER_PERMISSIONMODE_NORMAL 
COMMANDSENDER_PERMISSIONMODE_IGNORE 

Definition at line 16 of file CommandHandler.h.

◆ COMPONENT_TYPE

enum Leviathan::COMPONENT_TYPE : uint16_t
strong

Must contain all valid Component types.

Enumerator
Position 
RenderNode 
Todo:
Hidden as serialized data
Sendable 
Received 
Physics 
BoxGeometry 
Model 
Camera 
Animated 
Custom 

All values above this are application specific types.

Definition at line 21 of file Component.h.

◆ CONNECTION_ENCRYPTION

State of a connection's encryption.

Enumerator
Undecided 

The connection has not reached Secured state.

None 

The connection doesn't need encryption Must be agreed on by both the server and the client. Otherwise a forced disconnect must occur

Standard 

Strong. Forced use of public keys for all secure messages.

The standard preferred encyption. With both ends knowing each other's public key + an agreed symmetric key (AES) for less secure messages

Definition at line 63 of file CommonNetwork.h.

63  {
64 
66  Undecided,
67 
71  None,
72 
75  Standard
76 
78 };
The connection has not reached Secured state.
In this mode the View doesn't take any input under any circumstances.

◆ CONNECTION_RESTRICTION

Allows restricting connections to allow only certain packets.

Enumerator
None 
ReceiveRemoteConsole 

Definition at line 63 of file Connection.h.

In this mode the View doesn't take any input under any circumstances.

◆ CONNECTION_STATE

Main state of a connection.

Controls what packets can be received and also sending wrong ones will cause warning messages

Enumerator
NothingReceived 

This is active when just created the object. Moves to Punchthrough or Initial depending on whether a NAT is blocking the connection

Initial 

Begins the handshake with version number check.

Connected 

Moves to this state once handshake is complete.

Secured 

After a secure connection is set up, or if server tells client it isn't needed and client doesn't force secured

Authenticated 

Once the user has logged in and their unique ID has been verified At this point Player object should be created for the player. So that they can join a GameWorld

Closed 

Cannot receive anything. Caused by not receiving packets or an explicit close Will send a single close connection packet when moving to this state Invalidates Player object and forces a logout

Punchthrough 

When doing a NAT punch through, will move to Initial after this In this state 10 punch through packets will be sent separated by 100 ms

Definition at line 69 of file Connection.h.

◆ CONSOLECOMMANDRESULTSTATE

Enumerator
CONSOLECOMMANDRESULTSTATE_SUCCEEDED 
CONSOLECOMMANDRESULTSTATE_FAILED 
CONSOLECOMMANDRESULTSTATE_WAITINGFORMORE 

Definition at line 11 of file Console.h.

◆ CONSOLECOMMANDTYPE

Enumerator
CONSOLECOMMANDTYPE_NONE 
CONSOLECOMMANDTYPE_ADDVAR 
CONSOLECOMMANDTYPE_ADDFUNC 
CONSOLECOMMANDTYPE_DELVAR 
CONSOLECOMMANDTYPE_DELFUNC 
CONSOLECOMMANDTYPE_PRINTVAR 
CONSOLECOMMANDTYPE_PRINTFUNC 
CONSOLECOMMANDTYPE_ERROR 

Definition at line 17 of file Console.h.

◆ DECIMALSEPARATORTYPE

Enumerator
DECIMALSEPARATORTYPE_DOT 
DECIMALSEPARATORTYPE_COMMA 
DECIMALSEPARATORTYPE_BOTH 
DECIMALSEPARATORTYPE_NONE 

Definition at line 48 of file StringIterator.h.

◆ EQUALITYCHARACTER

Enumerator
EQUALITYCHARACTER_TYPE_EQUALITY 
EQUALITYCHARACTER_TYPE_DOUBLEDOTSTYLE 
EQUALITYCHARACTER_TYPE_ALL 

Definition at line 64 of file StringIterator.h.

◆ EVENT_TYPE

Engine events that are triggered at certain times.

Enumerator
EVENT_TYPE_ERROR 
EVENT_TYPE_WAKEUP 
EVENT_TYPE_GENERAL 
EVENT_TYPE_KEYPRESS 
EVENT_TYPE_KEYDOWN 
EVENT_TYPE_SHOW 
EVENT_TYPE_HIDE 
EVENT_TYPE_TICK 
EVENT_TYPE_REMOVE 
EVENT_TYPE_EVENT_SEQUENCE_BEGIN 
EVENT_TYPE_EVENT_SEQUENCE_END 
EVENT_TYPE_MOUSEMOVED 
EVENT_TYPE_MOUSEPOSITION 
EVENT_TYPE_GUIDISABLE 
EVENT_TYPE_GUIENABLE 
EVENT_TYPE_RESIZE 
EVENT_TYPE_WINDOW_RESIZE 
EVENT_TYPE_ONCLICK 
EVENT_TYPE_LISTENERVALUEUPDATED 
EVENT_TYPE_FRAME_BEGIN 
EVENT_TYPE_FRAME_END 
EVENT_TYPE_INIT 
EVENT_TYPE_RELEASE 
EVENT_TYPE_TEST 
EVENT_TYPE_CLIENT_INTERPOLATION 

Only called on the client when a frame is about to be renderd and interpolation status needs to be determined

EVENT_TYPE_ALL 

Definition at line 12 of file Event.h.

12  {
13  EVENT_TYPE_ERROR = 0,
40 
42 };

◆ FILEGROUP

Enumerator
FILEGROUP_MODEL 
FILEGROUP_TEXTURE 
FILEGROUP_SOUND 
FILEGROUP_SCRIPT 
FILEGROUP_OTHER 

Definition at line 15 of file FileSystem.h.

◆ INBUILT_WORLD_TYPE

enum Leviathan::INBUILT_WORLD_TYPE : int32_t
strong

Types of inbuilt world types.

Enumerator
Standard 

Definition at line 37 of file GameWorldFactory.h.

◆ ITERATORCALLBACK_RETURNTYPE

Enumerator
ITERATORCALLBACK_RETURNTYPE_STOP 
ITERATORCALLBACK_RETURNTYPE_CONTINUE 

Definition at line 70 of file StringIterator.h.

◆ ITERATORFLAG_SET

Set flags for the iterator, this is changed to this for performance.

Enumerator
ITERATORFLAG_SET_IGNORE_SPECIAL 

\ is found, next special character will be ignored

ITERATORFLAG_SET_STOP 

The iterator has finished the current operation and will stop for now.

ITERATORFLAG_SET_INSIDE_STRING 

Iterator is currently inside a string.

ITERATORFLAG_SET_INSIDE_STRING_DOUBLE 

Iterator is currently inside double quoted string, "like this".

ITERATORFLAG_SET_INSIDE_STRING_SINGLE 

Iterator is currently inside single quoted string, 'like this'.

ITERATORFLAG_SET_INSIDE_STRING_SINGLE_END 

Iterator is currently on the closing ' character and the string might end after this character

ITERATORFLAG_SET_INSIDE_STRING_DOUBLE_END 

Iterator is currently on the closing " character and the string might end after this character

ITERATORFLAG_SET_IGNORE_SPECIAL_END 

Set when the next character is no longer affected by \, meaning this is always set when ITERATORFLAG_SET_IGNORE_SPECIAL is set

ITERATORFLAG_SET_COMMENT_BEGINNING 

Set when a comment is beginning. The iterator is currently on a / character which is followed by a / or *

ITERATORFLAG_SET_INSIDE_COMMENT 

Set when a comment is active, the iterator is on either the beginning // or /* or the ending

ITERATORFLAG_SET_INSIDE_CPPCOMMENT 

Set when inside a // comment.

ITERATORFLAG_SET_INSIDE_CCOMMENT 

Set when inside a /* comment.

ITERATORFLAG_SET_CPPCOMMENT_END 

Set when a c++ style comment will end on the next character.

ITERATORFLAG_SET_CCOMMENT_END 

Set when a c style comment will end on the next character.

Definition at line 90 of file StringIterator.h.

90  {
91 
94 
106 
110 
114 
129 };
\ is found, next special character will be ignored
The iterator has finished the current operation and will stop for now.
Set when a c style comment will end on the next character.
Iterator is currently inside double quoted string, "like this".
Set when a c++ style comment will end on the next character.
Iterator is currently inside a string.
Iterator is currently inside single quoted string, 'like this'.

◆ NETWORK_REQUEST_TYPE

enum Leviathan::NETWORK_REQUEST_TYPE : uint16_t
strong
Enumerator
Connect 

Opening a connection.

Security 

Only one side of the connection can send this request, usually the client.

Authenticate 

Only the client may make this call, after this the Connection won't restrict any packets from being received

Identification 

This may be sent after CONNECTION_STATE::Connected has been reached "PongServer running version 0.5.1.0, status: 0/20"

Serverstatus 
RemoteConsoleOpen 
RemoteConsoleAccess 
CloseRemoteConsole 
DoRemoteConsoleOpen 

The receiving side is now allowed to open a remote console with the token.

JoinServer 

Client wants to join a server MasterServerToken The ID given by the master server

JoinGame 

Client requests to join active gamestate (if the options is not empty then the client is asking to join something specific)

GetSingleSyncValue 
GetAllSyncValues 
RequestCommandExecution 

Used to request the server to run a command, used for chat and other things

Todo:
Implement if(Command.length() > MAX_SERVERCOMMAND_LENGTH)
ConnectInput 

Sent when a player requests the server to connect a NetworkedInput.

Echo 

Sent by servers to ping (time the time a client takes to respond) clients.

WorldClockSync 

Contains timing data to sync world clocks on a client Ticks The amount of ticks to set or change by Absolute Whether the tick count should be set to be the current or just added to the current tick

EngineMSTweak The engine tick tweaking, this should only be applied by a single GameWorld

Custom 

Used for game specific requests.

Definition at line 16 of file NetworkRequest.h.

16  : uint16_t {
17 
19  Connect,
20 
22  Security,
23 
27 
31 
33 
35 
37 
39 
42 
45  JoinServer,
46 
49  JoinGame,
50 
52 
54 
58 
61 
63  Echo,
64 
73 
75  Custom
76 };
Only one side of the connection can send this request, usually the client.
All values above this are application specific types.
Sent when a player requests the server to connect a NetworkedInput.
The receiving side is now allowed to open a remote console with the token.
unsigned short uint16_t
Definition: core.h:39
Sent by servers to ping (time the time a client takes to respond) clients.

◆ NETWORK_RESPONSE_INVALIDREASON

Defines in what way a request was invalid can also define why a server disallowed a request.

Enumerator
Unauthenticated 

Returned when the connection is anonymous (the other client hasn't requested verified connection)

Unsupported 

Returned when we don't implement the wanted action for example if we are asked our server status and we aren't a server

ServerFull 

Server has maximum number of players.

ServerNotAcceptingPlayers 

Server is not accepting players.

NotAuthorized 

The client isn't properly authenticated for that action or the server received mismatching security / id numbers

ServerAlreadyConnectedToYou 

The client has already connected to the server, and must disconnect before trying again.

InvalidParameters 

The client has made a request with invalid or unsupported options.

ServerCustom 

The server has used a custom rule to disallow this.

Definition at line 105 of file CommonNetwork.h.

105  : uint8_t {
106 
110 
113  Unsupported,
114 
116  ServerFull,
117 
120 
124 
127 
130 
133 };
The server has used a custom rule to disallow this.
unsigned char uint8_t
Definition: core.h:38
The client has already connected to the server, and must disconnect before trying again.
The client has made a request with invalid or unsupported options.
Server has maximum number of players.

◆ NETWORK_RESPONSE_TYPE

enum Leviathan::NETWORK_RESPONSE_TYPE : uint16_t
strong

Defines the type of response that the packet contains.

Enumerator
Connect 

Sent in response to a NETWORK_REQUEST_TYPE::Connect.

Security 

Sent in response to a NETWORK_REQUEST_TYPE::Security

Todo:
Implemented packet breaking for this type
Authenticate 

Sent in response to a NETWORK_REQUEST_TYPE::Authenticate.

Identification 

Sent in response to a NETWORK_REQUEST_TYPE::Identification contains a user readable string, game name, game version and leviathan version strings

Keepalive 

Alias for None.

CloseConnection 

Immediately drops the connection when sent or received Uses class None

RemoteConsoleClosed 
RemoteConsoleOpened 
InvalidRequest 
ServerDisallow 

Sent by a server when it disallows a made request.

ServerAllow 

Sent by a server when a request is allowed.

ServerStatus 

Returns anonymous data about the server members: ServerNameString Contains the name of the server, should be limited to max 100 letters Joinable States if the server is joinable (has started, doesn't take slots into account)

JoinRestriction Defines the type of join authentication the server uses (restricts who can join)

Players Current human players on the server MaxPlayers Maximum human players Bots Current bots on the server ServerStatus The current status of the server. Used to define what the server is doing AdditionalFlags The flags of the server. These can be used based on the game for example to define game mode or level requirements or something else

SyncValData 

Sends a update/new SyncedValue.

SyncDataEnd 

Send after all SYNCVALDATA has been sent and indicates whether they should have arrived correctly

SyncResourceData 

Contains SyncedResource update notification.

CreateNetworkedInput 

Contains a new NetworkedInput.

UpdateNetworkedInput 

Contains control state updates regarding a NetworkedInput.

DisconnectInput 

Client sents this when they want input to be destroyed.

StartWorldReceive 

Contains information about a world that is about to be sent to the client.

EntityCreation 

A new entity was created on the server.

EntityUpdate 

Contains update data for a single entity TickNumber The tick on which this was generated

ReferenceTick The tick number against which this update has been created Special case is -1 which notes that there is no reference tick

EntityDestruction 

Contains (list) an ID for entity to be deleted.

EntityLocalControlStatus 

Grants or revokes local control from a client (this is used to notify the clients what is the status)

CacheUpdated 

Contains an updated cache variable.

CacheRemoved 

Contains the name of a removed cache variable.

WorldFrozen 

Sent when the server changes physics frozen state.

ServerHeartbeat 

A server heartbeat packet.

StartHeartbeats 

Marks that the client is required to send heartbeats.

None 

Empty response, used for keeping alive/nothing.

Custom 

The packet is a game specific packet!

See also
GameSpecificPacketHandler BaseGameSpecificFactory BaseGameSpecificResponsePacket

Definition at line 18 of file NetworkResponse.h.

18  : uint16_t {
19 
21  Connect,
22 
25  Security,
26 
29 
33 
35  Keepalive,
36 
40 
42 
44 
46 
49 
52 
69 
72 
76 
79 
82 
85 
88 
91 
94 
100  EntityUpdate,
101 
104 
108 
110  CacheUpdated,
111 
113  CacheRemoved,
114 
115  // //! Instructs a world to create or destroy a constraint
116  // //! Create When false the constraint is to be deleted
117  // EntityConstraint,
118 
120  WorldFrozen,
121 
124 
127 
129  None,
130 
133  Custom
134 };
Only one side of the connection can send this request, usually the client.
All values above this are application specific types.
Contains an updated cache variable.
Sent by a server when a request is allowed.
Sends a update/new SyncedValue.
In this mode the View doesn't take any input under any circumstances.
Client sents this when they want input to be destroyed.
Sent when the server changes physics frozen state.
Contains (list) an ID for entity to be deleted.
unsigned short uint16_t
Definition: core.h:39
Contains the name of a removed cache variable.
Contains SyncedResource update notification.
Contains information about a world that is about to be sent to the client.
Contains control state updates regarding a NetworkedInput.
Marks that the client is required to send heartbeats.
Sent by a server when it disallows a made request.
A new entity was created on the server.

◆ NETWORKED_TYPE

Type of networked application.

Enumerator
Client 
Server 
Master 
Error 

Only set when the derived class forgot to set it.

Definition at line 22 of file CommonNetwork.h.

◆ PACKET_TIMEOUT_STYLE

enum Leviathan::PACKET_TIMEOUT_STYLE : uint8_t
strong
Enumerator
Unified 

Loss is detected by packets received after and if a second has passed This makes all other styles deprecated

Definition at line 31 of file CommonNetwork.h.

31  : uint8_t {
32 
35  Unified
36 
39  // Timed,
40  //
43  // PacketsAfterReceived
44 };
unsigned char uint8_t
Definition: core.h:38

◆ PING_FAIL_REASON

If true 2 ack only packets are created each time one is sent.

Number of bytes that should be in each packet for it to be considered full Could probably be set to 1452 and still be fine on most connections But ipv4 promises that at least 512 byte payload should work The amount of received message numbers to keep in memory, these numbers are used to discard duplicates

This is required for ack only packets to work correctly (as they rely on getting a resend if the acks are lost) This is for debugging purposes to make sure that packet numbers and message numbers aren't used interchangeably anywhere Fail reason for ConnectionInfo::CalculateNetworkPing

Enumerator
LossTooHigh 
ConnectionClosed 

Definition at line 56 of file Connection.h.

◆ QUOTETYPE

Enumerator
QUOTETYPE_DOUBLEQUOTES 
QUOTETYPE_SINGLEQUOTES 
QUOTETYPE_BOTH 

Definition at line 46 of file StringIterator.h.

◆ RECEIVE_GUARANTEE

Controls whether a packet is critical.

Enumerator
None 

Packet is sent once and if lost won't be resent.

ResendOnce 

Packet will get a single resend.

Critical 

Packet must be received within a certain time or the connection is considered broken. Will resend until connection is closed

Definition at line 49 of file CommonNetwork.h.

49  {
50 
52  None,
53 
55  ResendOnce,
56 
59  Critical
60 };
In this mode the View doesn't take any input under any circumstances.
Packet will get a single resend.

◆ RECEIVED_STATE

For keeping track of received remote packets.

These are used to populate ack fields for outgoing packets

Enumerator
NotReceived 

Packet hasn't been received.

StateReceived 

Packet is received but no acks have been sent.

AcksSent 

Packet is received and an ack has been sent This is basically the same as ReceivedAckSucceeded

ReceivedAckSucceeded 

Packet is received and the ack is also received At this point we no longer need to think about this packet

Definition at line 22 of file NetworkAckField.h.

22  {
23 
25  NotReceived = 0,
26 
29 
32  AcksSent,
33 
37 };
Packet is received but no acks have been sent.
Packet hasn't been received.

◆ SCRIPT_RUN_RESULT

Enumerator
Success 
Error 
Suspended 

Definition at line 14 of file ScriptRunningSetup.h.

◆ SCRIPT_RUNTYPE

◆ ScriptAccess

enum Leviathan::ScriptAccess : uint32_t
strong
Note
There is a maximum of 32 of different masks that can be defined
Enumerator
Nothing 

Can access none of the bound functions or "inbuilt" math and string types.

Builtin 

Access to the builtin types like string and math functions.

DefaultEngine 

Default mask for engine classes (some things are accessible even with this off)

FullFileSystem 

Definition at line 12 of file AccessMask.h.

12  : uint32_t{
13 
15  Nothing = 0x0,
16 
18  Builtin = 0x1,
19 
21  DefaultEngine = 0x2,
22  FullFileSystem = 0x4,
23  // 0x8
24  // 0x10
25  // 0x20
26  //0x40
27  //0x80 // first byte full
28  //0x100
29  //0x200
30  //0x400
31  //0x800
32  //0x1000
33  //0x2000
34  //0x4000
35  //0x8000 // second byte full (int range might stop here(
36  //0x10000
37  //0x20000
38  //0x40000
39  //0x80000
40  //0x100000
41  //0x200000
42  //0x400000
43  //0x800000 // third byte full
44  //0x1000000
45  //0x2000000
46  //0x4000000
47  //0x8000000
48  //0x10000000
49  //0x20000000
50  //0x40000000
51  //0x80000000 // fourth byte full. Last valid flag for angelscript
52 };
Access to the builtin types like string and math functions.
Can access none of the bound functions or "inbuilt" math and string types.
Default mask for engine classes (some things are accessible even with this off)
unsigned int uint32_t
Definition: core.h:40

◆ SCRIPTBUILDSTATE

Enumerator
SCRIPTBUILDSTATE_EMPTY 
SCRIPTBUILDSTATE_READYTOBUILD 
SCRIPTBUILDSTATE_BUILT 
SCRIPTBUILDSTATE_FAILED 
SCRIPTBUILDSTATE_DISCARDED 

Only set when the module can no longer be retrieved, and the whole ScriptModule needs to be recreated

Definition at line 20 of file ScriptModule.h.

◆ SERVER_ACCEPTED_TYPE

enum Leviathan::SERVER_ACCEPTED_TYPE : uint8_t
strong

Defines what request the server accepted and any potential data.

Enumerator
ConnectAccepted 

Server has accepted your join request.

RequestQueued 

Server has accepted the request and will handle it soon.

Done 

The request is done.

Definition at line 136 of file CommonNetwork.h.

136  : uint8_t {
137 
140 
143 
145  Done
146 };
Server has accepted the request and will handle it soon.
unsigned char uint8_t
Definition: core.h:38
Server has accepted your join request.

◆ SERVER_JOIN_RESTRICT

enum Leviathan::SERVER_JOIN_RESTRICT : uint8_t
strong

Allows servers to control who can join.

Enumerator
None 

Everyone can join the server.

Localhost 
LAN 
Todo:
A proper lan detection
Whitelist 
Invite 
Friends 
Permissions 
Custom 

Definition at line 81 of file CommonNetwork.h.

◆ SERVER_STATUS

enum Leviathan::SERVER_STATUS : uint8_t
strong

Allows servers to tell clients what they are doing.

Enumerator
Starting 
Running 
Shutdown 
Restart 

Definition at line 96 of file CommonNetwork.h.

◆ SPECIAL_ITERATOR

Special case handling flags for iterator.

Enumerator
SPECIAL_ITERATOR_ONNEWLINE_STOP 
SPECIAL_ITERATOR_HANDLECOMMENTS_ASSTRING 

Causes comments to be handled as whitespace/delimiting.

Definition at line 76 of file StringIterator.h.

76  {
77 
79  // SPECIAL_ITERATOR_ONNEWLINE_WHITESPACE = 0x8,
82 };
Causes comments to be handled as whitespace/delimiting.

◆ UNNORMALCHARACTER

Enumerator
UNNORMALCHARACTER_TYPE_NON_ASCII 
UNNORMALCHARACTER_TYPE_CONTROLCHARACTERS 
UNNORMALCHARACTER_TYPE_WHITESPACE 
UNNORMALCHARACTER_TYPE_LOWCODES 
UNNORMALCHARACTER_TYPE_NON_NAMEVALID 
UNNORMALCHARACTER_TYPE_LINEEND 

Definition at line 55 of file StringIterator.h.

Function Documentation

◆ BindAnglesAndQuaternion()

bool Leviathan::BindAnglesAndQuaternion ( asIScriptEngine *  engine)

Definition at line 586 of file BSFBind.cpp.

587 {
588  if(engine->RegisterObjectType("Radian", sizeof(bs::Radian),
589  asOBJ_VALUE | asGetTypeTraits<bs::Radian>() | asOBJ_POD |
590  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
592  }
593 
594  if(engine->RegisterObjectType("Degree", sizeof(bs::Degree),
595  asOBJ_VALUE | asGetTypeTraits<bs::Degree>() | asOBJ_POD |
596  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
598  }
599 
600  if(engine->RegisterObjectType("Quaternion", sizeof(bs::Quaternion),
601  asOBJ_VALUE | asGetTypeTraits<bs::Quaternion>() | asOBJ_POD |
602  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
604  }
605 
606  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
607  "void f(float w, float x, float y, float z)", asFUNCTION(QuaternionProxyValues),
608  asCALL_CDECL_OBJFIRST) < 0) {
610  }
611 
612  if(engine->RegisterObjectMethod("Quaternion", "Vector3 xAxis() const",
613  asMETHOD(bs::Quaternion, xAxis), asCALL_THISCALL) < 0) {
615  }
616 
617  if(engine->RegisterObjectMethod("Quaternion", "Vector3 yAxis() const",
618  asMETHOD(bs::Quaternion, yAxis), asCALL_THISCALL) < 0) {
620  }
621 
622  if(engine->RegisterObjectMethod("Quaternion", "Vector3 zAxis() const",
623  asMETHOD(bs::Quaternion, zAxis), asCALL_THISCALL) < 0) {
625  }
626 
627  if(engine->RegisterObjectMethod("Quaternion", "Quaternion inverse() const",
628  asMETHOD(bs::Quaternion, inverse), asCALL_THISCALL) < 0) {
630  }
631 
632  if(engine->RegisterObjectMethod("Quaternion", "Vector3 opMul(const Vector3 &in vec) const",
633  asMETHOD(bs::Quaternion, rotate), asCALL_THISCALL) < 0) {
635  }
636 
637  if(engine->RegisterObjectMethod("Quaternion",
638  "Vector3 rotate(const Vector3 &in vec) const", asMETHOD(bs::Quaternion, rotate),
639  asCALL_THISCALL) < 0) {
641  }
642 
643  if(engine->RegisterObjectMethod("Quaternion",
644  "Quaternion opMul(const Quaternion &in vec) const",
645  asMETHODPR(bs::Quaternion, operator*,(const bs::Quaternion&) const, bs::Quaternion),
646  asCALL_THISCALL) < 0) {
648  }
649 
650  if(engine->RegisterObjectMethod("Quaternion",
651  "Quaternion& opAssign(const Quaternion &in quat)",
652  asMETHODPR(bs::Quaternion, operator=,(const bs::Quaternion&), bs::Quaternion&),
653  asCALL_THISCALL) < 0) {
655  }
656 
657  if(engine->RegisterObjectProperty("Quaternion", "float x", asOFFSET(bs::Quaternion, x)) <
658  0) {
659 
661  }
662 
663  if(engine->RegisterObjectProperty("Quaternion", "float y", asOFFSET(bs::Quaternion, y)) <
664  0) {
665 
667  }
668 
669  if(engine->RegisterObjectProperty("Quaternion", "float z", asOFFSET(bs::Quaternion, z)) <
670  0) {
671 
673  }
674 
675  if(engine->RegisterObjectProperty("Quaternion", "float w", asOFFSET(bs::Quaternion, w)) <
676  0) {
677 
679  }
680 
681 
682  if(engine->SetDefaultNamespace("bs::Quaternion") < 0) {
684  }
685 
686  if(engine->RegisterGlobalProperty("const bs::Quaternion IDENTITY",
687  const_cast<bs::Quaternion*>(&bs::Quaternion::IDENTITY)) < 0) {
689  }
690 
691  if(engine->SetDefaultNamespace("bs") < 0) {
693  }
694 
695  // ------------------------------------ //
696 
697  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT, "void f(float radians)",
698  asFUNCTION(RadianProxy), asCALL_CDECL_OBJFIRST) < 0) {
700  }
701 
702  if(engine->RegisterObjectBehaviour("Radian", asBEHAVE_CONSTRUCT,
703  "void f(const Degree &in degree)", asFUNCTION(RadianProxyDegree),
704  asCALL_CDECL_OBJFIRST) < 0) {
706  }
707 
708  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT, "void f(float degrees)",
709  asFUNCTION(DegreeProxy), asCALL_CDECL_OBJFIRST) < 0) {
711  }
712 
713  if(engine->RegisterObjectBehaviour("Degree", asBEHAVE_CONSTRUCT,
714  "void f(const Radian &in radian)", asFUNCTION(DegreeProxyRadian),
715  asCALL_CDECL_OBJFIRST) < 0) {
717  }
718 
719  if(engine->RegisterObjectMethod("Radian", "Degree opImplConv() const",
720  asFUNCTION(RadianToDegreeCast), asCALL_CDECL_OBJFIRST) < 0) {
722  }
723 
724  if(engine->RegisterObjectMethod("Radian", "float valueDegrees() const",
725  asMETHOD(bs::Radian, valueDegrees), asCALL_THISCALL) < 0) {
727  }
728 
729  if(engine->RegisterObjectMethod("Radian", "float valueRadians() const",
730  asMETHOD(bs::Radian, valueRadians), asCALL_THISCALL) < 0) {
732  }
733 
734  if(engine->RegisterObjectMethod("Radian", "float valueAngleUnits() const",
735  asMETHOD(bs::Radian, valueRadians), asCALL_THISCALL) < 0) {
737  }
738 
739  if(engine->RegisterObjectMethod("Degree", "Radian opImplConv() const",
740  asFUNCTION(DegreeToRadianCast), asCALL_CDECL_OBJFIRST) < 0) {
742  }
743 
744  if(engine->RegisterObjectMethod("Degree", "float valueDegrees() const",
745  asMETHOD(bs::Degree, valueDegrees), asCALL_THISCALL) < 0) {
747  }
748 
749  if(engine->RegisterObjectMethod("Degree", "float valueRadians() const",
750  asMETHOD(bs::Degree, valueRadians), asCALL_THISCALL) < 0) {
752  }
753 
754  if(engine->RegisterObjectMethod("Degree", "float valueAngleUnits() const",
755  asMETHOD(bs::Degree, valueDegrees), asCALL_THISCALL) < 0) {
757  }
758 
759  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
760  "void f(const Radian &in radian, const Vector3 &in vector)",
761  asFUNCTION(QuaternionProxyAroundAxis), asCALL_CDECL_OBJFIRST) < 0) {
763  }
764 
765  if(engine->RegisterObjectBehaviour("Quaternion", asBEHAVE_CONSTRUCT,
766  "void f(const Vector3 &in vector, const Radian &in radian)",
767  asFUNCTION(QuaternionProxyAroundAxisOtherWay), asCALL_CDECL_OBJFIRST) < 0) {
769  }
770 
771  return true;
772 }
void RadianProxyDegree(void *memory, const bs::Degree &degree)
Definition: BSFBind.cpp:75
bs::Degree RadianToDegreeCast(bs::Radian *self)
Definition: BSFBind.cpp:80
void QuaternionProxyValues(void *memory, float W, float X, float Y, float Z)
Definition: BSFBind.cpp:85
void DegreeProxy(void *memory, float degree)
Definition: BSFBind.cpp:55
void QuaternionProxyAroundAxisOtherWay(void *memory, const bs::Vector3 &vector, const bs::Radian &radian)
Definition: BSFBind.cpp:96
void RadianProxy(void *memory, float radian)
Definition: BSFBind.cpp:70
bs::Radian DegreeToRadianCast(bs::Degree *self)
Definition: BSFBind.cpp:65
void QuaternionProxyAroundAxis(void *memory, const bs::Radian &radian, const bs::Vector3 &vector)
Definition: BSFBind.cpp:90
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void DegreeProxyRadian(void *memory, const bs::Radian &radian)
Definition: BSFBind.cpp:60

◆ BindApplication()

bool Leviathan::BindApplication ( asIScriptEngine *  engine)

Definition at line 697 of file CommonEngineBind.cpp.

698 {
699 
700  if(engine->RegisterEnum("NETWORKED_TYPE") < 0) {
702  }
703 
708 
709  if(engine->RegisterObjectType("LeviathanApplication", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
711  }
712 
713  // Global get function //
714  if(engine->RegisterGlobalFunction("LeviathanApplication& GetLeviathanApplication()",
715  asFUNCTION(LeviathanApplication::Get), asCALL_CDECL) < 0) {
717  }
718 
719  if(engine->RegisterObjectMethod("LeviathanApplication", "void MarkAsClosing()",
720  asMETHOD(LeviathanApplication, MarkAsClosing), asCALL_THISCALL) < 0) {
722  }
723 
724  if(engine->RegisterObjectMethod("LeviathanApplication", "bool Quitting()",
725  asMETHOD(LeviathanApplication, Quitting), asCALL_THISCALL) < 0) {
727  }
728 
729  if(engine->RegisterObjectMethod("LeviathanApplication",
730  "NETWORKED_TYPE GetProgramNetType() const",
731  asMETHOD(LeviathanApplication, GetProgramNetType), asCALL_THISCALL) < 0) {
733  }
734 
735  return true;
736 }
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
NETWORKED_TYPE
Type of networked application.
Definition: CommonNetwork.h:22
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
Base class for all leviathan programs.
Definition: Application.h:16

◆ BindAudioSource()

bool Leviathan::BindAudioSource ( asIScriptEngine *  engine)

Definition at line 777 of file CommonEngineBind.cpp.

778 {
780 
781  if(engine->RegisterObjectMethod("AudioSource", "void Resume()",
782  asMETHOD(AudioSource, Resume), asCALL_THISCALL) < 0) {
784  }
785 
786  if(engine->RegisterObjectMethod(
787  "AudioSource", "void Pause()", asMETHOD(AudioSource, Pause), asCALL_THISCALL) < 0) {
789  }
790 
791  if(engine->RegisterObjectMethod(
792  "AudioSource", "void Stop()", asMETHOD(AudioSource, Stop), asCALL_THISCALL) < 0) {
794  }
795 
796  if(engine->RegisterObjectMethod("AudioSource", "bool IsPlaying() const",
797  asMETHOD(AudioSource, IsPlaying), asCALL_THISCALL) < 0) {
799  }
800 
801  if(engine->RegisterObjectMethod("AudioSource", "void SetVolume(float volume)",
802  asMETHOD(AudioSource, SetVolume), asCALL_THISCALL) < 0) {
804  }
805 
806  if(engine->RegisterObjectMethod("AudioSource", "bool HasInternalSource() const",
807  asMETHOD(AudioSource, HasInternalSource), asCALL_THISCALL) < 0) {
809  }
810 
811  return true;
812 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
Small ReferenceCounted wrapper around an audio source.
Definition: AudioSource.h:16

◆ BindBody()

bool Leviathan::BindBody ( asIScriptEngine *  engine)

Definition at line 40 of file PhysicsBind.cpp.

41 {
43 
44  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetVelocity() const",
45  asMETHODPR(PhysicsBody, GetVelocity, () const, Float3), asCALL_THISCALL) < 0) {
47  }
48 
49  if(engine->RegisterObjectMethod("PhysicsBody",
50  "void SetVelocity(const Float3 &in velocity) const",
51  asMETHOD(PhysicsBody, SetVelocity), asCALL_THISCALL) < 0) {
53  }
54 
55  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetAngularVelocity() const",
56  asMETHODPR(PhysicsBody, GetAngularVelocity, () const, Float3),
57  asCALL_THISCALL) < 0) {
59  }
60 
61  if(engine->RegisterObjectMethod("PhysicsBody",
62  "void SetAngularVelocity(const Float3 &in omega) const",
63  asMETHOD(PhysicsBody, SetAngularVelocity), asCALL_THISCALL) < 0) {
65  }
66 
67  if(engine->RegisterObjectMethod("PhysicsBody", "void ClearVelocity() const",
68  asMETHOD(PhysicsBody, ClearVelocity), asCALL_THISCALL) < 0) {
70  }
71 
72  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetTorque() const",
73  asMETHODPR(PhysicsBody, GetTorque, () const, Float3), asCALL_THISCALL) < 0) {
75  }
76 
77  if(engine->RegisterObjectMethod("PhysicsBody", "void ApplyTorque(const Float3 &in torque)",
78  asMETHOD(PhysicsBody, ApplyTorque), asCALL_THISCALL) < 0) {
80  }
81 
82  if(engine->RegisterObjectMethod("PhysicsBody", "void SetMass(float mass)",
83  asMETHOD(PhysicsBody, SetMass), asCALL_THISCALL) < 0) {
85  }
86 
87  if(engine->RegisterObjectMethod("PhysicsBody", "float get_Mass() const",
88  asMETHOD(PhysicsBody, GetMass), asCALL_THISCALL) < 0) {
90  }
91 
92  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ get_Shape() const",
93  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
95  }
96 
97  if(engine->RegisterObjectMethod("PhysicsBody", "PhysicsShape@ GetShape() const",
98  asMETHOD(PhysicsBody, GetShapeWrapper), asCALL_THISCALL) < 0) {
100  }
101 
102  if(engine->RegisterObjectMethod("PhysicsBody",
103  "bool SetPosition(const Float3 &in pos, const Float4 &in orientation)",
104  asMETHOD(PhysicsBody, SetPosition), asCALL_THISCALL) < 0) {
106  }
107 
108  if(engine->RegisterObjectMethod("PhysicsBody", "Float3 GetPosition() const",
109  asMETHOD(PhysicsBody, GetPosition), asCALL_THISCALL) < 0) {
111  }
112 
113  if(engine->RegisterObjectMethod("PhysicsBody",
114  "bool SetOnlyOrientation(const Float4 &in orientation)",
115  asMETHOD(PhysicsBody, SetOnlyOrientation), asCALL_THISCALL) < 0) {
117  }
118 
119  if(engine->RegisterObjectMethod("PhysicsBody",
120  "void GiveImpulse(const Float3 &in deltaspeed, const Float3 &in point = Float3(0))",
121  asMETHOD(PhysicsBody, GiveImpulse), asCALL_THISCALL) < 0) {
123  }
124 
125  if(engine->RegisterObjectMethod("PhysicsBody",
126  "void SetDamping(float linear, float angular)", asMETHOD(PhysicsBody, SetDamping),
127  asCALL_THISCALL) < 0) {
129  }
130 
131  if(engine->RegisterObjectMethod("PhysicsBody", "void SetFriction(float friction)",
132  asMETHOD(PhysicsBody, SetFriction), asCALL_THISCALL) < 0) {
134  }
135 
136  if(engine->RegisterObjectMethod("PhysicsBody",
137  "void ConstraintMovementAxises(const Float3 &in movement = Float3(1, 0, 1), const "
138  "Float3 &in rotation = Float3(0, 1, 0))",
139  asMETHOD(PhysicsBody, ConstraintMovementAxises), asCALL_THISCALL) < 0) {
141  }
142 
143  return true;
144 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
This is an instance of a collision body.
Definition: PhysicsBody.h:74
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindBSF()

bool Leviathan::BindBSF ( asIScriptEngine *  engine)

Definition at line 1028 of file BSFBind.cpp.

1029 {
1030  // This doesn't need to be restored if we fail //
1031  if(engine->SetDefaultNamespace("bs") < 0) {
1033  }
1034 
1035  if(!BindBSFTypeDefs(engine))
1036  return false;
1037 
1038  if(!BindVector3(engine))
1039  return false;
1040 
1041  if(!BindVector4(engine))
1042  return false;
1043 
1044  if(!BindColour(engine))
1045  return false;
1046 
1047  if(!BindAnglesAndQuaternion(engine))
1048  return false;
1049 
1050  if(!BindMatrix4(engine))
1051  return false;
1052 
1053  if(!BindPlane(engine))
1054  return false;
1055 
1056  if(!BindRay(engine))
1057  return false;
1058 
1059  if(!BindTextures(engine))
1060  return false;
1061 
1062  if(!BindMaterials(engine))
1063  return false;
1064 
1065  if(!BindMeshes(engine))
1066  return false;
1067 
1068  // if(!BindRenderQueue(engine))
1069  // return false;
1070 
1071  if(!BindScene(engine))
1072  return false;
1073 
1074  // if(engine->RegisterObjectType("Root", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
1075  // ANGELSCRIPT_REGISTERFAIL;
1076  // }
1077 
1078  // ------------------ Global functions ------------------ //
1079  // if(engine->RegisterGlobalFunction(
1080  // "Root@ Getbs()", asFUNCTION(ScriptGetbs), asCALL_CDECL) < 0) {
1081  // ANGELSCRIPT_REGISTERFAIL;
1082  // }
1083 
1084  if(engine->SetDefaultNamespace("") < 0) {
1086  }
1087 
1088  return true;
1089 }
bool BindMatrix4(asIScriptEngine *engine)
Definition: BSFBind.cpp:525
bool BindBSFTypeDefs(asIScriptEngine *engine)
Definition: BSFBind.cpp:355
bool BindRay(asIScriptEngine *engine)
Definition: BSFBind.cpp:800
bool BindColour(asIScriptEngine *engine)
Definition: BSFBind.cpp:465
bool BindTextures(asIScriptEngine *engine)
Definition: BSFBind.cpp:929
bool BindVector3(asIScriptEngine *engine)
Definition: BSFBind.cpp:380
bool BindAnglesAndQuaternion(asIScriptEngine *engine)
Definition: BSFBind.cpp:586
bool BindMaterials(asIScriptEngine *engine)
Definition: BSFBind.cpp:943
bool BindVector4(asIScriptEngine *engine)
Definition: BSFBind.cpp:432
bool BindMeshes(asIScriptEngine *engine)
Definition: BSFBind.cpp:1016
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
bool BindScene(asIScriptEngine *engine)
Definition: BSFBind.cpp:871
bool BindPlane(asIScriptEngine *engine)
Definition: BSFBind.cpp:774

◆ BindBSFConversions()

bool Leviathan::BindBSFConversions ( asIScriptEngine *  engine)

Definition at line 732 of file TypesBind.cpp.

733 {
734  if(engine->RegisterObjectBehaviour("bs::Vector3", asBEHAVE_CONSTRUCT,
735  "void f(const Float3 &in vector)", asFUNCTION(Vector3Float3Proxy),
736  asCALL_CDECL_OBJFIRST) < 0) {
738  }
739 
740  if(engine->RegisterObjectBehaviour("bs::Vector4", asBEHAVE_CONSTRUCT,
741  "void f(const Float4 &in values)", asFUNCTION(Vector4Float4Proxy),
742  asCALL_CDECL_OBJFIRST) < 0) {
744  }
745 
746  if(engine->RegisterObjectBehaviour("bs::Color", asBEHAVE_CONSTRUCT,
747  "void f(const Float4 &in values)", asFUNCTION(ColorFloat4Proxy),
748  asCALL_CDECL_OBJFIRST) < 0) {
750  }
751 
752  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
753  "void f(const bs::Vector3 &in vector)", asFUNCTION(Float3Vector3Proxy),
754  asCALL_CDECL_OBJFIRST) < 0) {
756  }
757 
758  if(engine->RegisterObjectMethod("Float3", "bs::Vector3 opImplConv() const",
759  asMETHOD(Float3, operator bs::Vector3), asCALL_THISCALL) < 0) {
761  }
762 
763  if(engine->RegisterObjectBehaviour("bs::Quaternion", asBEHAVE_CONSTRUCT,
764  "void f(const Float4 &in vector)", asFUNCTION(QuaternionFloat4Proxy),
765  asCALL_CDECL_OBJFIRST) < 0) {
767  }
768 
769  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
770  "void f(const bs::Quaternion &in quat)", asFUNCTION(Float4QuaternionProxy),
771  asCALL_CDECL_OBJFIRST) < 0) {
773  }
774 
775  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
776  "void f(const bs::Color &in colour)", asFUNCTION(Float4ColorProxy),
777  asCALL_CDECL_OBJFIRST) < 0) {
779  }
780 
781  if(engine->RegisterObjectMethod("bs::Quaternion", "Float4 opImplConv() const",
782  asFUNCTION(ConvertQuaternionToFloat4), asCALL_CDECL_OBJFIRST) < 0) {
784  }
785 
786  return true;
787 }
void Float4QuaternionProxy(void *memory, const bs::Quaternion &quat)
Definition: TypesBind.cpp:174
void ColorFloat4Proxy(void *memory, const Float4 &values)
Definition: TypesBind.cpp:189
Float4 ConvertQuaternionToFloat4(bs::Quaternion *self)
Definition: TypesBind.cpp:179
void Vector3Float3Proxy(void *memory, const Float3 &vector)
Definition: TypesBind.cpp:158
void Float3Vector3Proxy(void *memory, const bs::Vector3 &vector)
Definition: TypesBind.cpp:163
void Float4ColorProxy(void *memory, const bs::Color &values)
Definition: TypesBind.cpp:194
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Vector4Float4Proxy(void *memory, const Float4 &values)
Definition: TypesBind.cpp:184
void QuaternionFloat4Proxy(void *memory, const Float4 &vector)
Definition: TypesBind.cpp:169

◆ BindBSFTypeDefs()

bool Leviathan::BindBSFTypeDefs ( asIScriptEngine *  engine)

Definition at line 355 of file BSFBind.cpp.

356 {
357  if(engine->RegisterTypedef("Scene", "int32") < 0) {
358 
360  }
361 
362  // if constexpr(std::is_same_v<float, float>) {
363  // if(engine->RegisterTypedef("float", "float") < 0) {
364 
365  // ANGELSCRIPT_REGISTERFAIL;
366  // }
367  // } else if constexpr(std::is_same_v<float, double>) {
368  // if(engine->RegisterTypedef("float", "double") < 0) {
369 
370  // ANGELSCRIPT_REGISTERFAIL;
371  // }
372  // } else {
373  // // Would really love this to be a static assert but apparently that doesn't work
374  // LOG_FATAL("Unknown float used while trying to bind as stuff");
375  // }
376 
377  return true;
378 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindColour()

bool Leviathan::BindColour ( asIScriptEngine *  engine)

Definition at line 465 of file BSFBind.cpp.

466 {
467  if(engine->RegisterObjectType("Color", sizeof(bs::Color),
468  asOBJ_VALUE | asGetTypeTraits<bs::Color>() | asOBJ_POD |
469  asOBJ_APP_CLASS_ALLFLOATS) < 0) {
471  }
472 
473  if(engine->RegisterObjectBehaviour("Color", asBEHAVE_CONSTRUCT,
474  "void f(float r, float g, float b, float a = 1.0)", asFUNCTION(ColorProxy),
475  asCALL_CDECL_OBJFIRST) < 0) {
477  }
478 
479  if(engine->RegisterObjectBehaviour("Color", asBEHAVE_CONSTRUCT,
480  "void f(const Vector4 &in values)", asFUNCTION(ColorVector4Proxy),
481  asCALL_CDECL_OBJFIRST) < 0) {
483  }
484 
485  if(engine->RegisterObjectProperty("Color", "float r", asOFFSET(bs::Color, r)) < 0) {
487  }
488 
489  if(engine->RegisterObjectProperty("Color", "float g", asOFFSET(bs::Color, g)) < 0) {
491  }
492 
493  if(engine->RegisterObjectProperty("Color", "float b", asOFFSET(bs::Color, b)) < 0) {
495  }
496 
497  if(engine->RegisterObjectProperty("Color", "float a", asOFFSET(bs::Color, a)) < 0) {
499  }
500 
501  if(engine->RegisterObjectMethod("Color",
502  "void getHSB(float &out hue, float &out saturation, float &out brightness) "
503  "const",
504  asMETHOD(bs::Color, getHSB), asCALL_THISCALL) < 0) {
506  }
507 
508  if(engine->SetDefaultNamespace("bs::Color") < 0) {
510  }
511 
512  if(engine->RegisterGlobalFunction(
513  "bs::Color fromHSB(float hue, float saturation, float brightness)",
514  asFUNCTION(bs::Color::fromHSB), asCALL_CDECL) < 0) {
516  }
517 
518  if(engine->SetDefaultNamespace("bs") < 0) {
520  }
521 
522  return true;
523 }
void ColorVector4Proxy(void *memory, const bs::Vector4 &values)
Definition: BSFBind.cpp:38
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void ColorProxy(void *memory, float r, float g, float b, float a)
Definition: BSFBind.cpp:33

◆ BindComponentTypeID()

bool Leviathan::BindComponentTypeID ( asIScriptEngine *  engine,
const char *  name,
uint16_t *  value 
)

Helper for BindComponentTypes.

Definition at line 102 of file EntityBind.cpp.

103 {
104  if(engine->SetDefaultNamespace(name) < 0) {
106  }
107 
108  if(engine->RegisterGlobalProperty("const uint16 TYPE", value) < 0) {
109 
111  }
112 
113  if(engine->SetDefaultNamespace("") < 0) {
115  }
116 
117  return true;
118 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindComponentTypes()

bool Leviathan::BindComponentTypes ( asIScriptEngine *  engine)

Definition at line 120 of file EntityBind.cpp.

121 {
122  // ------------------------------------ //
123  // Position
124  if(engine->RegisterObjectType("Position", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
126  }
127 
128  if(engine->RegisterObjectProperty("Position", "bool Marked", asOFFSET(Position, Marked)) <
129  0) {
131  }
132 
133  if(engine->RegisterObjectProperty(
134  "Position", "Float3 _Position", asOFFSET(Position, Members._Position)) < 0) {
136  }
137 
138  if(engine->RegisterObjectProperty(
139  "Position", "Float4 _Orientation", asOFFSET(Position, Members._Orientation)) < 0) {
141  }
142 
143  if(!BindComponentTypeID(engine, "Position", &PositionTYPEProxy))
144  return false;
145 
146  // ------------------------------------ //
147  // Physics
148  if(engine->RegisterObjectType("Physics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
150  }
151 
152  // Currently does nothing
153  if(engine->RegisterObjectProperty("Physics", "bool Marked", asOFFSET(Physics, Marked)) <
154  0) {
156  }
157 
158  if(engine->RegisterObjectMethod("Physics", "PhysicsBody@ get_Body() const",
159  asMETHOD(Physics, GetBodyWrapper), asCALL_THISCALL) < 0) {
161  }
162 
163  if(engine->RegisterObjectMethod("Physics",
164  "PhysicsBody@ CreatePhysicsBody(PhysicalWorld@ world, PhysicsShape@ shape, "
165  "float mass, int physicsmaterialid = -1)",
166  asMETHOD(Physics, CreatePhysicsBodyWrapper), asCALL_THISCALL) < 0) {
168  }
169 
170  if(engine->RegisterObjectMethod("Physics",
171  "bool ChangeShape(PhysicalWorld@ world, PhysicsShape@ shape)",
172  asMETHOD(Physics, ChangeShapeWrapper), asCALL_THISCALL) < 0) {
174  }
175 
176  if(engine->RegisterObjectMethod("Physics", "void JumpTo(Position@ positiontosync)",
177  asMETHOD(Physics, JumpTo), asCALL_THISCALL) < 0) {
179  }
180 
181  if(engine->RegisterObjectMethod("Physics", "void Release(PhysicalWorld@ world)",
182  asMETHOD(Physics, Release), asCALL_THISCALL) < 0) {
184  }
185 
186  if(!BindComponentTypeID(engine, "Physics", &PhysicsTYPEProxy))
187  return false;
188 
189  // ------------------------------------ //
190  // RenderNode
191  if(engine->RegisterObjectType("RenderNode", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
193  }
194 
195  if(engine->RegisterObjectProperty(
196  "RenderNode", "bool Marked", asOFFSET(RenderNode, Marked)) < 0) {
198  }
199 
200  if(engine->RegisterObjectProperty(
201  "RenderNode", "Float3 Scale", asOFFSET(RenderNode, Scale)) < 0) {
203  }
204 
205  if(engine->RegisterObjectProperty(
206  "RenderNode", "bs::HSceneObject Node", asOFFSET(RenderNode, Node)) < 0) {
208  }
209 
210  if(engine->RegisterObjectProperty(
211  "RenderNode", "bool Hidden", asOFFSET(RenderNode, Hidden)) < 0) {
213  }
214 
215  if(!BindComponentTypeID(engine, "RenderNode", &RenderNodeTYPEProxy))
216  return false;
217 
218  // ------------------------------------ //
219  // Sendable
220  if(engine->RegisterObjectType("Sendable", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
222  }
223 
224  if(engine->RegisterObjectProperty("Sendable", "bool Marked", asOFFSET(Sendable, Marked)) <
225  0) {
227  }
228 
229  if(!BindComponentTypeID(engine, "Sendable", &SendableTYPEProxy))
230  return false;
231 
232  // ------------------------------------ //
233  // Received
234  if(engine->RegisterObjectType("Received", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
236  }
237 
238  if(engine->RegisterObjectProperty("Received", "bool Marked", asOFFSET(Received, Marked)) <
239  0) {
241  }
242 
243  if(!BindComponentTypeID(engine, "Received", &ReceivedTYPEProxy))
244  return false;
245 
246  // ------------------------------------ //
247  // Model
248  if(engine->RegisterObjectType("Model", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
250  }
251 
252  if(engine->RegisterObjectProperty("Model", "bool Marked", asOFFSET(Model, Marked)) < 0) {
254  }
255 
256  if(!BindComponentTypeID(engine, "Model", &ModelTYPEProxy))
257  return false;
258 
259  if(engine->RegisterObjectProperty(
260  "Model", "bs::HRenderable GraphicalObject", asOFFSET(Model, GraphicalObject)) < 0) {
262  }
263 
264  if(engine->RegisterObjectProperty(
265  "Model", "bs::HMaterial Material", asOFFSET(Model, Material)) < 0) {
267  }
268 
269  if(engine->RegisterObjectProperty("Model", "string MeshName", asOFFSET(Model, MeshName)) <
270  0) {
272  }
273 
274  // ------------------------------------ //
275  // BoxGeometry
276  if(engine->RegisterObjectType("BoxGeometry", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
278  }
279 
280  if(engine->RegisterObjectProperty(
281  "BoxGeometry", "bool Marked", asOFFSET(BoxGeometry, Marked)) < 0) {
283  }
284 
285  if(!BindComponentTypeID(engine, "BoxGeometry", &BoxGeometryTYPEProxy))
286  return false;
287 
288  // // ------------------------------------ //
289  // // ManualObject
290  // if(engine->RegisterObjectType("ManualObject", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
291  // ANGELSCRIPT_REGISTERFAIL;
292  // }
293 
294  // if(engine->RegisterObjectProperty(
295  // "ManualObject", "bool Marked", asOFFSET(ManualObject, Marked)) < 0) {
296  // ANGELSCRIPT_REGISTERFAIL;
297  // }
298 
299  // if(!BindComponentTypeID(engine, "ManualObject", &ManualObjectTYPEProxy))
300  // return false;
301 
302  // ------------------------------------ //
303  // Camera
304  if(engine->RegisterObjectType("Camera", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
306  }
307 
308  if(engine->RegisterObjectProperty("Camera", "bool Marked", asOFFSET(Camera, Marked)) < 0) {
310  }
311 
312  if(engine->RegisterObjectProperty("Camera", "uint8 FOV", asOFFSET(Camera, FOV)) < 0) {
314  }
315 
316  if(engine->RegisterObjectProperty(
317  "Camera", "bool SoundPerceiver", asOFFSET(Camera, SoundPerceiver)) < 0) {
319  }
320 
321  if(!BindComponentTypeID(engine, "Camera", &CameraTYPEProxy))
322  return false;
323 
324 
325  // // ------------------------------------ //
326  // // Plane
327  // if(engine->RegisterObjectType("Plane", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
328  // ANGELSCRIPT_REGISTERFAIL;
329  // }
330 
331  // if(engine->RegisterObjectProperty("Plane", "bool Marked", asOFFSET(Plane, Marked)) < 0)
332  // {
333  // ANGELSCRIPT_REGISTERFAIL;
334  // }
335 
336  // if(!BindComponentTypeID(engine, "Plane", &PlaneTYPEProxy))
337  // return false;
338 
339  // if(engine->RegisterObjectProperty(
340  // "Plane", "Ogre::Item@ GraphicalObject", asOFFSET(Plane, GraphicalObject)) < 0) {
341  // ANGELSCRIPT_REGISTERFAIL;
342  // }
343 
344  // ------------------------------------ //
345  // Animated
346  if(engine->RegisterObjectType("Animated", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
348  }
349 
350  if(engine->RegisterObjectProperty("Animated", "bool Marked", asOFFSET(Animated, Marked)) <
351  0) {
353  }
354 
355  if(!BindComponentTypeID(engine, "Animated", &AnimatedTYPEProxy))
356  return false;
357 
358  // if(engine->RegisterObjectProperty("Animated", "Ogre::Item@ GraphicalObject",
359  // asOFFSET(Animated, GraphicalObject)) < 0) {
360  // ANGELSCRIPT_REGISTERFAIL;
361  // }
362 
363  // ------------------------------------ //
364  // SimpleAnimation
365  if(engine->RegisterObjectType("SimpleAnimation", sizeof(SimpleAnimation),
366  asOBJ_VALUE | asGetTypeTraits<SimpleAnimation>()) < 0) {
368  }
369  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_CONSTRUCT,
370  "void f(const string &in name)", asFUNCTION(SimpleAnimationConstructorProxy),
371  asCALL_CDECL_OBJFIRST) < 0) {
373  }
374  if(engine->RegisterObjectBehaviour("SimpleAnimation", asBEHAVE_DESTRUCT, "void f()",
375  asFUNCTION(SimpleAnimationDestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
377  }
378 
379  if(engine->RegisterObjectProperty(
380  "SimpleAnimation", "bool Loop", asOFFSET(SimpleAnimation, Loop)) < 0) {
382  }
383 
384  if(engine->RegisterObjectProperty("SimpleAnimation", "float SpeedFactor",
385  asOFFSET(SimpleAnimation, SpeedFactor)) < 0) {
387  }
388 
389  if(engine->RegisterObjectProperty(
390  "SimpleAnimation", "bool Paused", asOFFSET(SimpleAnimation, Paused)) < 0) {
392  }
393 
394  // Animation helpers
395  if(engine->RegisterObjectMethod("Animated",
396  "void AddAnimation(const SimpleAnimation &in animation)",
397  asFUNCTION(AnimatedAddHelper), asCALL_CDECL_OBJFIRST) < 0) {
399  }
400 
401  if(engine->RegisterObjectMethod("Animated", "SimpleAnimation& GetAnimation(uint64 index)",
402  asFUNCTION(AnimatedGetHelper), asCALL_CDECL_OBJFIRST) < 0) {
404  }
405 
406  return true;
407 }
Entity is received from a server.
Definition: Components.h:170
static uint16_t SendableTYPEProxy
Definition: EntityBind.cpp:92
static uint16_t PhysicsTYPEProxy
Definition: EntityBind.cpp:89
static uint16_t ReceivedTYPEProxy
Definition: EntityBind.cpp:93
void SimpleAnimationDestructorProxy(void *memory)
Definition: EntityBind.cpp:43
Contains an animation for Animated component.
Definition: Components.h:256
static uint16_t BoxGeometryTYPEProxy
Definition: EntityBind.cpp:95
void SimpleAnimationConstructorProxy(void *memory, const std::string &name)
Definition: EntityBind.cpp:38
Entity has a box for geometry/model, possibly also physics.
Definition: Components.h:211
Entity has position and direction it is looking at.
Definition: Components.h:34
Entity has a scene node.
Definition: Components.h:79
void AnimatedAddHelper(Animated *self, const SimpleAnimation &animation)
Definition: EntityBind.cpp:48
Entity has a physical component.
Definition: Components.h:346
SimpleAnimation * AnimatedGetHelper(Animated *self, uint64_t index)
Definition: EntityBind.cpp:54
Entity has a model.
Definition: Components.h:232
static uint16_t AnimatedTYPEProxy
Definition: EntityBind.cpp:99
Properties that a camera entity has (will also need a Position component)
Definition: Components.h:713
static uint16_t ModelTYPEProxy
Definition: EntityBind.cpp:94
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
bool BindComponentTypeID(asIScriptEngine *engine, const char *name, uint16_t *value)
Helper for BindComponentTypes.
Definition: EntityBind.cpp:102
Entity plays animations on an Ogre::Item.
Definition: Components.h:295
Entity is sendable to clients.
Definition: Components.h:115
static uint16_t PositionTYPEProxy
Definition: EntityBind.cpp:90
static uint16_t RenderNodeTYPEProxy
Definition: EntityBind.cpp:91
static uint16_t CameraTYPEProxy
Definition: EntityBind.cpp:96

◆ BindDataBlock()

bool Leviathan::BindDataBlock ( asIScriptEngine *  engine)

Definition at line 293 of file CommonEngineBind.cpp.

294 {
295 
296  ANGELSCRIPT_REGISTER_REF_TYPE("ScriptSafeVariableBlock", ScriptSafeVariableBlock);
297 
298  // Some factories //
299  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
300  "ScriptSafeVariableBlock@ f(const string &in blockname, const string &in value)",
301  asFUNCTION(ScriptSafeVariableBlockFactoryString), asCALL_CDECL) < 0) {
303  }
304 
305  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
306  "ScriptSafeVariableBlock@ f(const string &in blockname, float value)",
307  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<float>), asCALL_CDECL) < 0) {
309  }
310 
311  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
312  "ScriptSafeVariableBlock@ f(const string &in blockname, int value)",
313  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<int>), asCALL_CDECL) < 0) {
315  }
316 
317  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
318  "ScriptSafeVariableBlock@ f(const string &in blockname, double value)",
319  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<double>), asCALL_CDECL) < 0) {
321  }
322 
323  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
324  "ScriptSafeVariableBlock@ f(const string &in blockname, int8 value)",
325  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<char>), asCALL_CDECL) < 0) {
327  }
328 
329  if(engine->RegisterObjectBehaviour("ScriptSafeVariableBlock", asBEHAVE_FACTORY,
330  "ScriptSafeVariableBlock@ f(const string &in blockname, bool value)",
331  asFUNCTION(ScriptSafeVariableBlockFactoryGeneric<bool>), asCALL_CDECL) < 0) {
333  }
334 
335  // Implicit casts for normal types //
336  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "string opImplConv() const",
337  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<std::string>),
338  asCALL_GENERIC) < 0) {
340  }
341 
342  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int opImplConv() const",
343  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<int>),
344  asCALL_GENERIC) < 0) {
346  }
347 
348  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "int8 opImplConv() const",
349  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<char>),
350  asCALL_GENERIC) < 0) {
352  }
353 
354  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "float opImplConv() const",
355  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<float>),
356  asCALL_GENERIC) < 0) {
358  }
359 
360  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "double opImplConv() const",
361  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<double>),
362  asCALL_GENERIC) < 0) {
364  }
365 
366  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool opImplConv() const",
367  WRAP_MFN(ScriptSafeVariableBlock, ConvertAndReturnVariable<bool>),
368  asCALL_GENERIC) < 0) {
370  }
371 
372  // type check //
373  if(engine->RegisterObjectMethod("ScriptSafeVariableBlock", "bool IsValidType()",
374  asMETHOD(ScriptSafeVariableBlock, IsValidType), asCALL_THISCALL) < 0) {
376  }
377 
378 
379  return true;
380 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
Reference counted version for scripts of VariableBlock.
Definition: DataBlock.h:840
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
ScriptSafeVariableBlock * ScriptSafeVariableBlockFactoryString(const std::string &blockname, const std::string &valuestr)

◆ BindDelegates()

bool Leviathan::BindDelegates ( asIScriptEngine *  engine)

Definition at line 753 of file CommonEngineBind.cpp.

754 {
755 
756  if(engine->RegisterFuncdef("void DelegateCallbackFunc(NamedVars@ values)") < 0) {
758  }
759 
761 
762  if(engine->RegisterObjectMethod("Delegate", "void Call(NamedVars@ values) const",
763  asMETHODPR(Delegate, Call, (NamedVars*)const, void), asCALL_THISCALL) < 0) {
765  }
766 
767  if(engine->RegisterObjectMethod("Delegate",
768  "void Register(DelegateCallbackFunc@ callback)", asFUNCTION(DelegateRegisterProxy),
769  asCALL_CDECL_OBJFIRST) < 0) {
771  }
772 
773 
774  return true;
775 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
An object which can accept BaseDelegateSlot derived callbacks that can be called when the event repre...
Definition: DelegateSlot.h:52
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
static void DelegateRegisterProxy(Delegate *obj, asIScriptFunction *callback)

◆ BindEngine()

bool Leviathan::BindEngine ( asIScriptEngine *  engine)

Definition at line 607 of file CommonEngineBind.cpp.

608 {
609  if(engine->RegisterObjectType("Engine", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
611  }
612 
613  // Global get function //
614  if(engine->RegisterGlobalFunction(
615  "Engine& GetEngine()", asFUNCTION(Engine::Get), asCALL_CDECL) < 0) {
617  }
618 
619  // Engine owned singletons //
620  if(!BindRandom(engine))
621  return false;
622 
623  if(engine->RegisterObjectMethod("Engine", "Random& GetRandom()",
624  asMETHOD(Engine, GetRandom), asCALL_THISCALL) < 0) {
626  }
627 
628  if(engine->RegisterObjectMethod("Engine", "EventHandler& GetEventHandler()",
629  asMETHOD(Engine, GetEventHandler), asCALL_THISCALL) < 0) {
631  }
632 
633  if(engine->RegisterObjectMethod("Engine", "SoundDevice& GetSoundDevice()",
634  asMETHOD(Engine, GetSoundDevice), asCALL_THISCALL) < 0) {
636  }
637 
638  if(engine->RegisterObjectMethod("Engine", "FileSystem& GetFileSystem()",
639  asMETHOD(Engine, GetFileSystem), asCALL_THISCALL) < 0) {
641  }
642 
643  if(engine->RegisterObjectMethod("Engine", "ThreadingManager& GetThreadingManager()",
644  asMETHOD(Engine, GetThreadingManager), asCALL_THISCALL) < 0) {
646  }
647 
648  if(engine->RegisterObjectMethod("Engine", "Window& GetWindowEntity()",
649  asMETHOD(Engine, GetWindowEntity), asCALL_THISCALL) < 0) {
651  }
652 
653  if(engine->RegisterObjectMethod("Engine", "Graphics& GetGraphics()",
654  asMETHOD(Engine, GetGraphics), asCALL_THISCALL) < 0) {
656  }
657 
658  // ------------------------------------ //
659 
660  if(engine->RegisterObjectMethod("Engine", "int64 GetTimeSinceLastTick()",
661  asMETHOD(Engine, GetTimeSinceLastTick), asCALL_THISCALL) < 0) {
663  }
664 
665  if(engine->RegisterObjectMethod("Engine", "int GetCurrentTick()",
666  asMETHOD(Engine, GetCurrentTick), asCALL_THISCALL) < 0) {
668  }
669 
670  if(engine->RegisterObjectMethod("Engine", "int GetWindowOpenCount()",
671  asMETHOD(Engine, GetWindowOpenCount), asCALL_THISCALL) < 0) {
673  }
674 
675  if(engine->RegisterObjectMethod(
676  "Engine", "void MarkQuit()", asMETHOD(Engine, MarkQuit), asCALL_THISCALL) < 0) {
678  }
679 
680  if(engine->RegisterObjectMethod("Engine", "bool IsOnMainThread()",
681  asMETHOD(Engine, IsOnMainThread), asCALL_THISCALL) < 0) {
683  }
684 
685  if(engine->RegisterFuncdef("void InvokeCallbackFunc()") < 0) {
687  }
688 
689  if(engine->RegisterObjectMethod("Engine", "void Invoke(InvokeCallbackFunc@ callback)",
690  asFUNCTION(InvokeProxy), asCALL_CDECL_OBJFIRST) < 0) {
692  }
693 
694  return true;
695 }
The main class of the Leviathan Game Engine.
Definition: Engine.h:34
bool BindRandom(asIScriptEngine *engine)
static void InvokeProxy(Engine *obj, asIScriptFunction *callback)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindEngineCommon()

bool Leviathan::BindEngineCommon ( asIScriptEngine *  engine)

Definition at line 897 of file CommonEngineBind.cpp.

898 {
899 
900  if(!BindNamedVars(engine))
901  return false;
902 
903  if(!BindEvents(engine))
904  return false;
905 
906  if(!BindSound(engine))
907  return false;
908 
909  if(!BindFileSystem(engine))
910  return false;
911 
912  if(!BindGraphics(engine))
913  return false;
914 
915  if(!BindThreadingManager(engine))
916  return false;
917 
918  if(!BindWindow(engine))
919  return false;
920 
921  if(!BindEngine(engine))
922  return false;
923 
924  if(!BindApplication(engine))
925  return false;
926 
927  if(!BindGameModule(engine))
928  return false;
929 
930  if(!BindDelegates(engine))
931  return false;
932 
933 
934  // ------------------ Global functions ------------------ //
935  if(engine->RegisterGlobalFunction("string GetLeviathanVersion()",
936  asFUNCTION(GetLeviathanVersionProxy), asCALL_CDECL) < 0) {
938  }
939 
940  if(engine->RegisterGlobalFunction("void LOG_WRITE(const string &in message)",
941  asFUNCTION(LOG_WRITEProxy), asCALL_CDECL) < 0) {
943  }
944 
945  if(engine->RegisterGlobalFunction("void LOG_INFO(const string &in message)",
946  asFUNCTION(LOG_INFOProxy), asCALL_CDECL) < 0) {
948  }
949 
950  if(engine->RegisterGlobalFunction("void LOG_WARNING(const string &in message)",
951  asFUNCTION(LOG_WARNINGProxy), asCALL_CDECL) < 0) {
953  }
954 
955  if(engine->RegisterGlobalFunction("void LOG_ERROR(const string &in message)",
956  asFUNCTION(LOG_ERRORProxy), asCALL_CDECL) < 0) {
958  }
959  // LOG_FATAL not bound
960  // Use assert instead
961 
962  if(engine->RegisterGlobalFunction("void Print(const string &in message)",
963  asFUNCTION(Logger::Print), asCALL_CDECL) < 0) {
965  }
966 
967  if(engine->RegisterGlobalFunction("void assert(bool expression, const string &in message)",
968  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
970  }
971  if(engine->RegisterGlobalFunction("void assert(bool expression)",
972  asFUNCTION(AngelScriptAssertWrapper), asCALL_GENERIC) < 0) {
974  }
975 
976  if(engine->RegisterGlobalFunction(
977  "bool IsInGraphicalMode()", asFUNCTION(IsInGraphicalMode), asCALL_CDECL) < 0) {
979  }
980 
981  if(engine->RegisterGlobalFunction(
982  "void PrintCallStack()", asFUNCTION(PrintASCallStack), asCALL_CDECL) < 0) {
984  }
985 
986  // ------------------------------------ //
987  // Global vars
988  if(engine->RegisterGlobalProperty("const float PI", &PIProxy) < 0) {
989 
991  }
992 
993  if(engine->RegisterGlobalProperty("const float EPSILON", &EPSILONProxy) < 0) {
994 
996  }
997 
998  if(engine->RegisterGlobalProperty(
999  "const float DEGREES_TO_RADIANS", &DEGREES_TO_RADIANSProxy) < 0) {
1000 
1002  }
1003 
1004  if(engine->RegisterGlobalProperty(
1005  "const float RADIANS_TO_DEGREES", &RADIANS_TO_DEGREESProxy) < 0) {
1006 
1008  }
1009 
1010  if(engine->RegisterGlobalProperty("const int TICKSPEED", &TICKSPEEDProxy) < 0) {
1011 
1013  }
1014 
1015  return true;
1016 }
bool BindEngine(asIScriptEngine *engine)
bool BindEvents(asIScriptEngine *engine)
static std::string GetLeviathanVersionProxy()
void PrintASCallStack()
Prints current angelscript callstack.
bool BindNamedVars(asIScriptEngine *engine)
bool BindDelegates(asIScriptEngine *engine)
static void LOG_ERRORProxy(const std::string &str)
static void LOG_WARNINGProxy(const std::string &str)
bool BindWindow(asIScriptEngine *engine)
bool BindGraphics(asIScriptEngine *engine)
static void LOG_INFOProxy(const std::string &str)
static void LOG_WRITEProxy(const std::string &str)
bool BindThreadingManager(asIScriptEngine *engine)
bool BindFileSystem(asIScriptEngine *engine)
static float RADIANS_TO_DEGREESProxy
bool BindApplication(asIScriptEngine *engine)
static float EPSILONProxy
bool BindGameModule(asIScriptEngine *engine)
static float PIProxy
bool IsInGraphicalMode()
void AngelScriptAssertWrapper(asIScriptGeneric *gen)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
static float DEGREES_TO_RADIANSProxy
bool BindSound(asIScriptEngine *engine)
static int TICKSPEEDProxy

◆ BindEntity()

bool Leviathan::BindEntity ( asIScriptEngine *  engine)
Todo:
Create a wrapper around NewtonBody which has reference counting

Definition at line 532 of file EntityBind.cpp.

533 {
534 
535  // TODO: add reference counting for GameWorld
536  if(engine->RegisterObjectType("GameWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
538  }
539 
540  if(!BindScriptComponentTypeSupport(engine))
541  return false;
542 
543  if(!BindRayCast(engine))
544  return false;
545 
546  if(!BindComponentTypes(engine))
547  return false;
548 
549  if(!BindGameWorldBaseMethods<GameWorld>(engine, "GameWorld"))
550  return false;
551 
552  // Component get functions //
553  // GameWorld
554 
555  // ------------------------------------ //
556  if(engine->RegisterObjectType("StandardWorld", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
558  }
559 
560  if(!BindStandardWorldMethods<StandardWorld>(engine, "StandardWorld"))
561  return false;
562 
563  // ------------------------------------ //
564 
565  return true;
566 }
bool BindScriptComponentTypeSupport(asIScriptEngine *engine)
Definition: EntityBind.cpp:409
bool BindRayCast(asIScriptEngine *engine)
Definition: EntityBind.cpp:68
bool BindComponentTypes(asIScriptEngine *engine)
Definition: EntityBind.cpp:120
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindEvents()

bool Leviathan::BindEvents ( asIScriptEngine *  engine)

Definition at line 382 of file CommonEngineBind.cpp.

383 {
384  // Bind event type enum //
385  if(engine->RegisterEnum("EVENT_TYPE") < 0) {
387  }
388 
393 
394  // bind event //
396 
397  if(engine->RegisterObjectBehaviour("Event", asBEHAVE_FACTORY, "Event@ f(EVENT_TYPE type)",
398  asFUNCTION(WrapperEventFactory), asCALL_CDECL) < 0) {
400  }
401 
402  // bind generic event //
404 
405  // Factory //
406  if(engine->RegisterObjectBehaviour("GenericEvent", asBEHAVE_FACTORY,
407  "GenericEvent@ f(const string &in typename)",
408  asFUNCTION(WrapperGenericEventFactory), asCALL_CDECL) < 0) {
410  }
411 
412  // Data get function //
413  if(engine->RegisterObjectMethod("GenericEvent", "NamedVars@ GetNamedVars()",
414  asMETHOD(GenericEvent, GetNamedVarsRefCounted), asCALL_THISCALL) < 0) {
416  }
417 
418  if(engine->RegisterObjectMethod("GenericEvent", "string GetType() const",
419  asMETHOD(GenericEvent, GetType), asCALL_THISCALL) < 0) {
421  }
422 
423  // Event handler which cannot be instantiated or copied around //
424  if(engine->RegisterObjectType("EventHandler", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
426  }
427 
428  // Script event firing //
429  if(engine->RegisterObjectMethod("EventHandler", "void CallEvent(GenericEvent@ event)",
430  asMETHODPR(EventHandler, CallEvent, (GenericEvent*), void), asCALL_THISCALL) < 0) {
432  }
433 
434  // Event listener //
436 
437  if(engine->RegisterFuncdef("int OnEventCallback(Event@ event)") < 0) {
439  }
440 
441  if(engine->RegisterFuncdef("int OnGenericEventCallback(GenericEvent@ event)") < 0) {
443  }
444 
445  if(engine->RegisterObjectBehaviour("EventListener", asBEHAVE_FACTORY,
446  "EventListener@ f(OnEventCallback@ onevent, OnGenericEventCallback@ ongeneric)",
447  asFUNCTION(Script::EventListenerFactory), asCALL_CDECL) < 0) {
449  }
450 
451  if(engine->RegisterObjectMethod("EventListener", "bool RegisterForEvent(EVENT_TYPE type)",
452  asMETHOD(Script::EventListener, RegisterForEventType), asCALL_THISCALL) < 0) {
454  }
455 
456  if(engine->RegisterObjectMethod("EventListener",
457  "bool RegisterForEvent(const string &in name)",
458  asMETHOD(Script::EventListener, RegisterForEventGeneric), asCALL_THISCALL) < 0) {
460  }
461 
462 
463  return true;
464 }
Class that represents a statically defined event.
Definition: Event.h:138
Allows object to register for events that can be fired from anywhere.
Definition: EventHandler.h:15
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
EVENT_TYPE
Engine events that are triggered at certain times.
Definition: Event.h:12
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
Class that represents a dynamically defined event.
Definition: Event.h:173
EventListener * EventListenerFactory(asIScriptFunction *onevent, asIScriptFunction *ongeneric)
Event * WrapperEventFactory(EVENT_TYPE type)
GenericEvent * WrapperGenericEventFactory(const std::string &name)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
An EventListener that scripts can use to listen for events.

◆ BindFileSystem()

bool Leviathan::BindFileSystem ( asIScriptEngine *  engine)

Definition at line 840 of file CommonEngineBind.cpp.

841 {
842  // Many of the filesystem methods aren't safe to expose to every
843  // script so they are hidden by default
844  if(engine->RegisterEnum("FILEGROUP") < 0) {
846  }
847 
853 
854  if(engine->RegisterObjectType("FileSystem", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
856  }
857 
858  const auto oldMask =
859  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
860 
861  if(engine->RegisterObjectMethod("FileSystem",
862  "string SearchForFile(FILEGROUP which, const string &in name, const string &in "
863  "extensions, bool searchall = true)",
864  asMETHOD(FileSystem, SearchForFile), asCALL_THISCALL) < 0) {
866  }
867 
868  // Restore access for non-full access requiring static stuff
869  engine->SetDefaultAccessMask(oldMask);
870 
871  // ------------------------------------ //
872  // Static methods
873  if(engine->SetDefaultNamespace("FileSystem") < 0) {
875  }
876 
877  // And back to protected functions
878  engine->SetDefaultAccessMask(static_cast<AccessFlags>(ScriptAccess::FullFileSystem));
879 
880  if(engine->RegisterGlobalFunction("bool FileExists(const string &in filepath)",
881  asFUNCTION(FileSystem::FileExists), asCALL_CDECL) < 0) {
882 
884  }
885 
886  // Restore settings //
887  engine->SetDefaultAccessMask(oldMask);
888  if(engine->SetDefaultNamespace("") < 0) {
890  }
891 
892  return true;
893 }
Class for indexing and searching game data directory.
Definition: FileSystem.h:65
#define ANGELSCRIPT_REGISTER_ENUM_VALUE(enum, x)
Definition: BindHelpers.h:107
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindFloat2()

bool Leviathan::BindFloat2 ( asIScriptEngine *  engine)

Definition at line 205 of file TypesBind.cpp.

206 {
207 
208  if(engine->RegisterObjectType("Float2", sizeof(Float2),
209  asOBJ_VALUE | asGetTypeTraits<Float2>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
211  }
212  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f()",
213  asFUNCTION(Float2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
215  }
216  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT, "void f(float value)",
217  asFUNCTION(Float2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
219  }
220  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
221  "void f(float x, float y)", asFUNCTION(Float2ConstructorProxyAll),
222  asCALL_CDECL_OBJFIRST) < 0) {
224  }
225  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_CONSTRUCT,
226  "void f(const Float2 &in other)", asFUNCTION(Float2ConstructorProxyCopy),
227  asCALL_CDECL_OBJFIRST) < 0) {
229  }
230  if(engine->RegisterObjectBehaviour("Float2", asBEHAVE_DESTRUCT, "void f()",
231  asFUNCTION(Float2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
233  }
234  // Operators //
235  if(engine->RegisterObjectMethod("Float2", "Float2& opAssign(const Float2 &in other)",
236  asMETHODPR(Float2, operator=,(const Float2&), Float2&), asCALL_THISCALL) < 0) {
238  }
239 
240  if(engine->RegisterObjectMethod("Float2", "Float2 opAdd(const Float2 &in other) const",
241  asMETHODPR(Float2, operator+,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
243  }
244 
245  if(engine->RegisterObjectMethod("Float2", "Float2 opSub(const Float2 &in other) const",
246  asMETHODPR(Float2, operator-,(const Float2&) const, Float2), asCALL_THISCALL) < 0) {
248  }
249 
250  if(engine->RegisterObjectMethod("Float2", "Float2 opMul(float multiply) const",
251  asMETHODPR(Float2, operator*,(float) const, Float2), asCALL_THISCALL) < 0) {
253  }
254 
255  if(engine->RegisterObjectMethod("Float2", "Float2 Normalize() const",
256  asMETHOD(Float2, Normalize), asCALL_THISCALL) < 0) {
258  }
259 
260  if(engine->RegisterObjectMethod(
261  "Float2", "float HAddAbs()", asMETHOD(Float2, HAddAbs), asCALL_THISCALL) < 0) {
263  }
264 
265  if(engine->RegisterObjectMethod("Float2", "bool HasInvalidValues() const",
266  asMETHOD(Float2, HasInvalidValues), asCALL_THISCALL) < 0) {
268  }
269 
270  // Direct access
271  if(engine->RegisterObjectProperty("Float2", "float X", asOFFSET(Float2, X)) < 0) {
272 
274  }
275 
276  if(engine->RegisterObjectProperty("Float2", "float Y", asOFFSET(Float2, Y)) < 0) {
277 
279  }
280 
281  return true;
282 }
void Float2ConstructorProxyAll(void *memory, float x, float y)
Definition: TypesBind.cpp:22
void Float2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:17
void Float2ConstructorProxyCopy(void *memory, const Float2 &other)
Definition: TypesBind.cpp:32
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Float2DestructorProxy(void *memory)
Definition: TypesBind.cpp:37
void Float2ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:27

◆ BindFloat3()

bool Leviathan::BindFloat3 ( asIScriptEngine *  engine)

Definition at line 284 of file TypesBind.cpp.

285 {
286  if(engine->RegisterObjectType("Float3", sizeof(Float3),
287  asOBJ_VALUE | asGetTypeTraits<Float3>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
289  }
290  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f()",
291  asFUNCTION(Float3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
293  }
294  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT, "void f(float value)",
295  asFUNCTION(Float3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
297  }
298  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
299  "void f(float x, float y, float z)", asFUNCTION(Float3ConstructorProxyAll),
300  asCALL_CDECL_OBJFIRST) < 0) {
302  }
303  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
304  "void f(const Float3 &in other)", asFUNCTION(Float3ConstructorProxyCopy),
305  asCALL_CDECL_OBJFIRST) < 0) {
307  }
308  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_CONSTRUCT,
309  "void f(const Int3 &in values)", asFUNCTION(Float3ConstructorProxyFromInt3),
310  asCALL_CDECL_OBJFIRST) < 0) {
312  }
313 
314  if(engine->RegisterObjectBehaviour("Float3", asBEHAVE_DESTRUCT, "void f()",
315  asFUNCTION(Float3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
317  }
318  // Operators //
319  if(engine->RegisterObjectMethod("Float3", "Float3& opAssign(const Float3 &in other)",
320  asMETHODPR(Float3, operator=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
322  }
323 
324  if(engine->RegisterObjectMethod("Float3", "Float3 opAdd(const Float3 &in other) const",
325  asMETHODPR(Float3, operator+,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
327  }
328 
329  if(engine->RegisterObjectMethod("Float3", "Float3 opNeg() const",
330  asMETHODPR(Float3, operator-,() const, Float3), asCALL_THISCALL) < 0) {
332  }
333 
334  if(engine->RegisterObjectMethod("Float3", "bool opEquals(const Float3 &in other) const",
335  asMETHODPR(Float3, operator==,(const Float3&) const, bool), asCALL_THISCALL) < 0) {
337  }
338 
339  if(engine->RegisterObjectMethod("Float3", "Float3& opAddAssign(const Float3 &in other)",
340  asMETHODPR(Float3, operator+=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
342  }
343 
344  if(engine->RegisterObjectMethod("Float3", "Float3& opSubAssign(const Float3 &in other)",
345  asMETHODPR(Float3, operator-=,(const Float3&), Float3&), asCALL_THISCALL) < 0) {
347  }
348 
349  if(engine->RegisterObjectMethod("Float3", "Float3 opSub(const Float3 &in other) const",
350  asMETHODPR(Float3, operator-,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
352  }
353 
354  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(float multiply) const",
355  asMETHODPR(Float3, operator*,(float) const, Float3), asCALL_THISCALL) < 0) {
357  }
358 
359  if(engine->RegisterObjectMethod("Float3", "Float3 opMul(const Float3 &in other) const",
360  asMETHODPR(Float3, operator*,(const Float3&) const, Float3), asCALL_THISCALL) < 0) {
362  }
363 
364  if(engine->RegisterObjectMethod("Float3", "Float3& opDivAssign(float value)",
365  asMETHODPR(Float3, operator/=,(float), Float3&), asCALL_THISCALL) < 0) {
367  }
368 
369 
370  if(engine->RegisterObjectMethod("Float3", "Float3 Normalize() const",
371  asMETHOD(Float3, Normalize), asCALL_THISCALL) < 0) {
373  }
374 
375  if(engine->RegisterObjectMethod("Float3", "float HAddAbs() const",
376  asMETHOD(Float3, HAddAbs), asCALL_THISCALL) < 0) {
378  }
379 
380  if(engine->RegisterObjectMethod(
381  "Float3", "float HAdd() const", asMETHOD(Float3, HAdd), asCALL_THISCALL) < 0) {
383  }
384 
385  if(engine->RegisterObjectMethod("Float3", "float LengthSquared() const",
386  asMETHOD(Float3, LengthSquared), asCALL_THISCALL) < 0) {
388  }
389 
390  if(engine->RegisterObjectMethod("Float3", "float Dot(const Float3 &in val) const",
391  asMETHOD(Float3, Dot), asCALL_THISCALL) < 0) {
393  }
394 
395  if(engine->RegisterObjectMethod("Float3", "Float3 Cross(const Float3 &in val) const",
396  asMETHOD(Float3, Cross), asCALL_THISCALL) < 0) {
398  }
399 
400  if(engine->RegisterObjectMethod("Float3", "bool HasInvalidValues() const",
401  asMETHOD(Float3, HasInvalidValues), asCALL_THISCALL) < 0) {
403  }
404 
405  // Direct access
406  if(engine->RegisterObjectProperty("Float3", "float X", asOFFSET(Float3, X)) < 0) {
407 
409  }
410 
411  if(engine->RegisterObjectProperty("Float3", "float Y", asOFFSET(Float3, Y)) < 0) {
412 
414  }
415 
416  if(engine->RegisterObjectProperty("Float3", "float Z", asOFFSET(Float3, Z)) < 0) {
417 
419  }
420 
421 
422  // ------------------------------------ //
423  // Named ones
424  if(engine->SetDefaultNamespace("Float3") < 0) {
426  }
427 
428  if(engine->RegisterGlobalProperty("const Float3 UnitVUp", &UnitVUpProxy) < 0) {
429 
431  }
432 
433  if(engine->SetDefaultNamespace("") < 0) {
435  }
436 
437 
438 
439  return true;
440 }
void Float3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:43
void Float3ConstructorProxyFromInt3(void *memory, const Int3 &values)
Definition: TypesBind.cpp:63
void Float3ConstructorProxyAll(void *memory, float x, float y, float z)
Definition: TypesBind.cpp:48
static auto UnitVUpProxy
Definition: TypesBind.cpp:199
void Float3DestructorProxy(void *memory)
Definition: TypesBind.cpp:68
void Float3ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:53
void Float3ConstructorProxyCopy(void *memory, const Float3 &other)
Definition: TypesBind.cpp:58
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindFloat4()

bool Leviathan::BindFloat4 ( asIScriptEngine *  engine)

Definition at line 442 of file TypesBind.cpp.

443 {
444 
445  // Float4
446  if(engine->RegisterObjectType("Float4", sizeof(Float4),
447  asOBJ_VALUE | asGetTypeTraits<Float4>() | asOBJ_APP_CLASS_ALLFLOATS) < 0) {
449  }
450 
451  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f()",
452  asFUNCTION(Float4ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
454  }
455 
456  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT, "void f(float value)",
457  asFUNCTION(Float4ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
459  }
460 
461  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
462  "void f(float x, float y, float z, float w)", asFUNCTION(Float4ConstructorProxyAll),
463  asCALL_CDECL_OBJFIRST) < 0) {
465  }
466 
467  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_CONSTRUCT,
468  "void f(const Float4 &in other)", asFUNCTION(Float4ConstructorProxyCopy),
469  asCALL_CDECL_OBJFIRST) < 0) {
471  }
472 
473  if(engine->RegisterObjectBehaviour("Float4", asBEHAVE_DESTRUCT, "void f()",
474  asFUNCTION(Float4DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
476  }
477 
478  // Operators //
479  if(engine->RegisterObjectMethod("Float4", "Float4& opAssign(const Float4 &in other)",
480  asMETHODPR(Float4, operator=,(const Float4&), Float4&), asCALL_THISCALL) < 0) {
482  }
483 
484  if(engine->RegisterObjectMethod("Float4", "bool opEquals(const Float4 &in other) const",
485  asMETHODPR(Float4, operator==,(const Float4&) const, bool), asCALL_THISCALL) < 0) {
487  }
488 
489  if(engine->RegisterObjectMethod("Float4", "Float4 opAdd(const Float4 &in other) const",
490  asMETHODPR(Float4, operator+,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
492  }
493 
494  if(engine->RegisterObjectMethod("Float4", "Float4 opSub(const Float4 &in other) const",
495  asMETHODPR(Float4, operator-,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
497  }
498 
499  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(float multiply) const",
500  asMETHODPR(Float4, operator*,(float) const, Float4), asCALL_THISCALL) < 0) {
502  }
503 
504  if(engine->RegisterObjectMethod("Float4", "Float4 opMul(const Float4 &in other) const",
505  asMETHODPR(Float4, operator*,(const Float4&) const, Float4), asCALL_THISCALL) < 0) {
507  }
508 
509  if(engine->RegisterObjectMethod("Float4", "Float4 Normalize() const",
510  asMETHOD(Float4, Normalize), asCALL_THISCALL) < 0) {
512  }
513 
514  if(engine->RegisterObjectMethod(
515  "Float4", "Float3 ToAxis() const", asMETHOD(Float4, ToAxis), asCALL_THISCALL) < 0) {
517  }
518 
519  if(engine->RegisterObjectMethod("Float4", "float ToAngle() const",
520  asMETHOD(Float4, ToAngle), asCALL_THISCALL) < 0) {
522  }
523 
524  if(engine->RegisterObjectMethod("Float4", "Float4 Inverse() const",
525  asMETHOD(Float4, Inverse), asCALL_THISCALL) < 0) {
527  }
528 
529  if(engine->RegisterObjectMethod("Float4",
530  "Float3 RotateVector(const Float3 &in vector) const",
531  asMETHOD(Float4, RotateVector), asCALL_THISCALL) < 0) {
533  }
534 
535  if(engine->RegisterObjectMethod("Float4",
536  "Float4 Slerp(const Float4 &in other, float fraction) const",
537  asMETHOD(Float4, Slerp), asCALL_THISCALL) < 0) {
539  }
540 
541  if(engine->RegisterObjectMethod("Float4", "bool HasInvalidValues() const",
542  asMETHOD(Float4, HasInvalidValues), asCALL_THISCALL) < 0) {
544  }
545 
546  // Direct access
547  if(engine->RegisterObjectProperty("Float4", "float X", asOFFSET(Float4, X)) < 0) {
548 
550  }
551 
552  if(engine->RegisterObjectProperty("Float4", "float Y", asOFFSET(Float4, Y)) < 0) {
553 
555  }
556 
557  if(engine->RegisterObjectProperty("Float4", "float Z", asOFFSET(Float4, Z)) < 0) {
558 
560  }
561 
562  if(engine->RegisterObjectProperty("Float4", "float W", asOFFSET(Float4, W)) < 0) {
563 
565  }
566 
567  // ------------------------------------ //
568  // Named ones
569  if(engine->SetDefaultNamespace("Float4") < 0) {
571  }
572 
573  if(engine->RegisterGlobalProperty("const Float4 IdentityQuaternion", IdentityQuaternion) <
574  0) {
575 
577  }
578 
579  if(engine->RegisterGlobalFunction(
580  "Float4 QuaternionLookAt(const Float3 &in sourcepoint, const Float3 &in target)",
581  asFUNCTION(Float4::QuaternionLookAt), asCALL_CDECL) < 0) {
582 
584  }
585 
586  if(engine->SetDefaultNamespace("") < 0) {
588  }
589 
590  return true;
591 }
Float4 IdentityQuaternion
Definition: TypesBind.cpp:14
void Float4ConstructorProxyAll(void *memory, float x, float y, float z, float w)
Definition: TypesBind.cpp:79
void Float4ConstructorProxyCopy(void *memory, const Float4 &other)
Definition: TypesBind.cpp:89
void Float4ConstructorProxy(void *memory)
Definition: TypesBind.cpp:74
void Float4ConstructorProxySingle(void *memory, float all)
Definition: TypesBind.cpp:84
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Float4DestructorProxy(void *memory)
Definition: TypesBind.cpp:94

◆ BindGameModule()

bool Leviathan::BindGameModule ( asIScriptEngine *  engine)

Definition at line 738 of file CommonEngineBind.cpp.

739 {
740 
742 
743  // Bind simple name get function //
744  if(engine->RegisterObjectMethod("GameModule", "string GetDescription(bool full = false)",
745  asMETHOD(GameModule, GetDescription), asCALL_THISCALL) < 0) {
747  }
748 
749 
750  return true;
751 }
#define ANGELSCRIPT_REGISTER_REF_TYPE(RegisterName, ClassName)
Definition: BindHelpers.h:92
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
Represents a scriptable part of a program.
Definition: GameModule.h:18

◆ BindGameWorldBaseMethods()

template<class WorldType >
bool Leviathan::BindGameWorldBaseMethods ( asIScriptEngine *  engine,
const char *  classname 
)

Definition at line 15 of file StandardWorldBindHelper.h.

16 {
17 
18  if(engine->RegisterObjectMethod(classname, "ObjectID CreateEntity()",
19  asMETHOD(WorldType, CreateEntity), asCALL_THISCALL) < 0) {
21  }
22 
23  // Use this rather than DestroyEntity
24  if(engine->RegisterObjectMethod(classname, "void QueueDestroyEntity(ObjectID id)",
25  asMETHOD(WorldType, QueueDestroyEntity), asCALL_THISCALL) < 0) {
27  }
28 
29  if(engine->RegisterObjectMethod(classname, "bool DestroyEntity(ObjectID id)",
30  asMETHOD(WorldType, DestroyEntity), asCALL_THISCALL) < 0) {
32  }
33 
34  if(engine->RegisterObjectMethod(classname,
35  "void SetEntitysParent(ObjectID child, ObjectID parent)",
36  asMETHOD(WorldType, SetEntitysParent), asCALL_THISCALL) < 0) {
38  }
39 
40  if(engine->RegisterObjectMethod(classname, "PhysicalWorld@ GetPhysicalWorld()",
41  asMETHOD(WorldType, GetPhysicalWorld), asCALL_THISCALL) < 0) {
43  }
44 
45  if(engine->RegisterObjectMethod(classname,
46  "int GetPhysicalMaterial(const string &in name)",
47  asMETHOD(WorldType, GetPhysicalMaterial), asCALL_THISCALL) < 0) {
49  }
50 
51  // if(engine->RegisterObjectMethod(classname,
52  // "RayCastHitEntity@ CastRayGetFirstHit(Float3 start, Float3 end)",
53  // asMETHOD(WorldType, CastRayGetFirstHitProxy), asCALL_THISCALL) < 0) {
54  // ANGELSCRIPT_REGISTERFAIL;
55  // }
56 
57  if(engine->RegisterObjectMethod(classname,
58  "bs::Ray CastRayFromCamera(float x, float y) const",
59  asMETHOD(WorldType, CastRayFromCamera), asCALL_THISCALL) < 0) {
61  }
62 
63  // ------------------------------------ //
64  // Support for script types
65  if(engine->RegisterObjectMethod(classname,
66  "array<ObjectID>@ GetRemovedIDsForComponents(array<uint16>@ componenttypes)",
67  asMETHOD(WorldType, GetRemovedIDsForComponents), asCALL_THISCALL) < 0) {
69  }
70 
71  if(engine->RegisterObjectMethod(classname,
72  "array<ObjectID>@ GetRemovedIDsForScriptComponents(array<string>@ typenames)",
73  asMETHOD(WorldType, GetRemovedIDsForScriptComponents), asCALL_THISCALL) < 0) {
75  }
76 
77  if(engine->RegisterObjectMethod(classname,
78  "bool RegisterScriptComponentType(const string &in name, ComponentFactoryFunc@ "
79  "factory)",
80  asMETHOD(WorldType, RegisterScriptComponentType), asCALL_THISCALL) < 0) {
82  }
83 
84  if(engine->RegisterObjectMethod(classname,
85  "bool RegisterScriptSystem(const string &in name, ScriptSystem@ systemobject)",
86  asMETHOD(WorldType, RegisterScriptSystem), asCALL_THISCALL) < 0) {
88  }
89 
90  if(engine->RegisterObjectMethod(classname,
91  "bool UnregisterScriptSystem(const string &in name)",
92  asMETHOD(WorldType, UnregisterScriptSystem), asCALL_THISCALL) < 0) {
94  }
95 
96  if(engine->RegisterObjectMethod(classname,
97  "ScriptComponentHolder@ GetScriptComponentHolder(const string &in name)",
98  asMETHOD(WorldType, GetScriptComponentHolder), asCALL_THISCALL) < 0) {
100  }
101 
102  if(engine->RegisterObjectMethod(classname,
103  "ScriptSystem@ GetScriptSystem(const string &in name)",
104  asMETHOD(WorldType, GetScriptSystem), asCALL_THISCALL) < 0) {
106  }
107 
108  // ------------------------------------ //
109  if(engine->RegisterObjectMethod(classname, "bs::Scene GetScene()",
110  asMETHOD(WorldType, GetScene), asCALL_THISCALL) < 0) {
112  }
113 
114  // ------------------------------------ //
115  // Somewhat questionable Ogre shortcuts that should probably be component types
116  if(engine->RegisterObjectMethod(classname, "void SetSunlight()",
117  asMETHOD(WorldType, SetSunlight), asCALL_THISCALL) < 0) {
119  }
120 
121  if(engine->RegisterObjectMethod(classname, "void RemoveSunlight()",
122  asMETHOD(WorldType, RemoveSunlight), asCALL_THISCALL) < 0) {
124  }
125 
126  // if(engine->RegisterObjectMethod(classname,
127  // "void SetLightProperties(const Ogre::ColourValue &in diffuse, const "
128  // "Ogre::ColourValue &in specular, const Ogre::Vector3 &in direction, float power,
129  // " "const Ogre::ColourValue &in upperhemisphere, const Ogre::ColourValue &in "
130  // "lowerhemisphere, const Ogre::Vector3 &in hemispheredir, float envmapscale
131  // = 1.0f)", asMETHOD(WorldType, SetLightProperties), asCALL_THISCALL) < 0) {
132  // ANGELSCRIPT_REGISTERFAIL;
133  // }
134 
135  // ------------------------------------ //
136  // These are inefficient versions of the get methods, prefer the ones in derived classes
137  if(engine->RegisterObjectMethod(classname,
138  "Physics@ BaseWorldGetComponentPhysics(ObjectID id)",
139  asMETHODPR(WorldType, template GetComponent<Physics>, (ObjectID), Physics&),
140  asCALL_THISCALL) < 0) {
142  }
143 
144  if(engine->RegisterObjectMethod(classname,
145  "Position@ BaseWorldGetComponentPosition(ObjectID id)",
146  asMETHODPR(WorldType, template GetComponent<Position>, (ObjectID), Position&),
147  asCALL_THISCALL) < 0) {
149  }
150 
151  return true;
152 }
int32_t ObjectID
Definition: EntityCommon.h:11
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindGraphics()

bool Leviathan::BindGraphics ( asIScriptEngine *  engine)

Definition at line 591 of file CommonEngineBind.cpp.

592 {
593  if(engine->RegisterObjectType("Graphics", 0, asOBJ_REF | asOBJ_NOCOUNT) < 0) {
595  }
596 
597  // Use the shader constructor taking a string instead
598  // if(engine->RegisterObjectMethod("Graphics",
599  // "bs::HShader LoadShaderByName(const string &in name)",
600  // asMETHOD(Graphics, LoadShaderByName), asCALL_THISCALL) < 0) {
601  // ANGELSCRIPT_REGISTERFAIL;
602  // }
603 
604  return true;
605 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindGUI()

bool Leviathan::BindGUI ( asIScriptEngine *  engine)

Definition at line 25 of file GuiScriptBind.cpp.

26 {
27  // GuiManager needed to use some functionality, registered so that it cannot be stored //
28  if(engine->RegisterObjectType("GuiManager", 0, asOBJ_REF | asOBJ_NOHANDLE) < 0) {
30  }
31 
32  return true;
33 }
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindInt2()

bool Leviathan::BindInt2 ( asIScriptEngine *  engine)

Definition at line 593 of file TypesBind.cpp.

594 {
595 
596  if(engine->RegisterObjectType("Int2", sizeof(Int2),
597  asOBJ_VALUE | asGetTypeTraits<Int2>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
599  }
600  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f()",
601  asFUNCTION(Int2ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
603  }
604  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int value)",
605  asFUNCTION(Int2ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
607  }
608  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT, "void f(int x, int y)",
609  asFUNCTION(Int2ConstructorProxyAll), asCALL_CDECL_OBJFIRST) < 0) {
611  }
612  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_CONSTRUCT,
613  "void f(const Int2 &in other)", asFUNCTION(Int2ConstructorProxyCopy),
614  asCALL_CDECL_OBJFIRST) < 0) {
616  }
617  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_DESTRUCT, "void f()",
618  asFUNCTION(Int2DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
620  }
621 
622  if(engine->RegisterObjectBehaviour("Int2", asBEHAVE_LIST_CONSTRUCT,
623  "void f(const int &in) {int, int}", asFUNCTION(Int2ListConstructor),
624  asCALL_CDECL_OBJFIRST) < 0) {
626  }
627 
628  // Operators //
629  if(engine->RegisterObjectMethod("Int2", "Int2& opAssign(const Int2 &in other)",
630  asMETHODPR(Int2, operator=,(const Int2&), Int2&), asCALL_THISCALL) < 0) {
632  }
633 
634  if(engine->RegisterObjectMethod("Int2", "Int2 opAdd(const Int2 &in other) const",
635  asMETHODPR(Int2, operator+,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
637  }
638 
639  if(engine->RegisterObjectMethod("Int2", "Int2 opSub(const Int2 &in other) const",
640  asMETHODPR(Int2, operator-,(const Int2&) const, Int2), asCALL_THISCALL) < 0) {
642  }
643 
644  if(engine->RegisterObjectMethod("Int2", "Int2 opMul(int multiply) const",
645  asMETHODPR(Int2, operator*,(int) const, Int2), asCALL_THISCALL) < 0) {
647  }
648 
649  // Direct access
650  if(engine->RegisterObjectProperty("Int2", "int X", asOFFSET(Int2, X)) < 0) {
651 
653  }
654 
655  if(engine->RegisterObjectProperty("Int2", "int Y", asOFFSET(Int2, Y)) < 0) {
656 
658  }
659 
660  return true;
661 }
void Int2DestructorProxy(void *memory)
Definition: TypesBind.cpp:125
void Int2ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:110
void Int2ConstructorProxyAll(void *memory, int x, int y)
Definition: TypesBind.cpp:105
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Int2ListConstructor(void *memory, int *list)
Definition: TypesBind.cpp:120
void Int2ConstructorProxy(void *memory)
Definition: TypesBind.cpp:100
void Int2ConstructorProxyCopy(void *memory, const Int2 &other)
Definition: TypesBind.cpp:115

◆ BindInt3()

bool Leviathan::BindInt3 ( asIScriptEngine *  engine)

Definition at line 663 of file TypesBind.cpp.

664 {
665 
666  if(engine->RegisterObjectType("Int3", sizeof(Int3),
667  asOBJ_VALUE | asGetTypeTraits<Int3>() | asOBJ_APP_CLASS_ALLINTS) < 0) {
669  }
670  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f()",
671  asFUNCTION(Int3ConstructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
673  }
674  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT, "void f(int value)",
675  asFUNCTION(Int3ConstructorProxySingle), asCALL_CDECL_OBJFIRST) < 0) {
677  }
678  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
679  "void f(int x, int y, int z)", asFUNCTION(Int3ConstructorProxyAll),
680  asCALL_CDECL_OBJFIRST) < 0) {
682  }
683  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_CONSTRUCT,
684  "void f(const Int3 &in other)", asFUNCTION(Int3ConstructorProxyCopy),
685  asCALL_CDECL_OBJFIRST) < 0) {
687  }
688  if(engine->RegisterObjectBehaviour("Int3", asBEHAVE_DESTRUCT, "void f()",
689  asFUNCTION(Int3DestructorProxy), asCALL_CDECL_OBJFIRST) < 0) {
691  }
692  // Operators //
693  if(engine->RegisterObjectMethod("Int3", "Int3& opAssign(const Int3 &in other)",
694  asMETHODPR(Int3, operator=,(const Int3&), Int3&), asCALL_THISCALL) < 0) {
696  }
697 
698  if(engine->RegisterObjectMethod("Int3", "Int3 opAdd(const Int3 &in other) const",
699  asMETHODPR(Int3, operator+,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
701  }
702 
703  if(engine->RegisterObjectMethod("Int3", "Int3 opSub(const Int3 &in other) const",
704  asMETHODPR(Int3, operator-,(const Int3&) const, Int3), asCALL_THISCALL) < 0) {
706  }
707 
708  if(engine->RegisterObjectMethod("Int3", "Int3 opMul(int multiply) const",
709  asMETHODPR(Int3, operator*,(int) const, Int3), asCALL_THISCALL) < 0) {
711  }
712 
713  // Direct access
714  if(engine->RegisterObjectProperty("Int3", "int X", asOFFSET(Int3, X)) < 0) {
715 
717  }
718 
719  if(engine->RegisterObjectProperty("Int3", "int Y", asOFFSET(Int3, Y)) < 0) {
720 
722  }
723 
724  if(engine->RegisterObjectProperty("Int3", "int Z", asOFFSET(Int3, Z)) < 0) {
725 
727  }
728 
729  return true;
730 }
void Int3ConstructorProxy(void *memory)
Definition: TypesBind.cpp:131
void Int3DestructorProxy(void *memory)
Definition: TypesBind.cpp:151
void Int3ConstructorProxyAll(void *memory, int x, int y, int z)
Definition: TypesBind.cpp:136
void Int3ConstructorProxySingle(void *memory, int all)
Definition: TypesBind.cpp:141
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void Int3ConstructorProxyCopy(void *memory, const Int3 &other)
Definition: TypesBind.cpp:146

◆ BindMaterials()

bool Leviathan::BindMaterials ( asIScriptEngine *  engine)

Definition at line 943 of file BSFBind.cpp.

944 {
945  if(engine->RegisterEnum("BuiltinShader") < 0) {
947  }
948 
949  if(engine->SetDefaultNamespace("bs::BuiltinShader") < 0) {
951  }
952 
954  "BuiltinShader", "Standard", bs::BuiltinShader::Standard);
955 
957  "BuiltinShader", "Transparent", bs::BuiltinShader::Transparent);
958 
960  "BuiltinShader", "ParticlesUnlit", bs::BuiltinShader::ParticlesUnlit);
961 
963  "BuiltinShader", "ParticlesLit", bs::BuiltinShader::ParticlesLit);
964 
966  "BuiltinShader", "ParticlesLitOpaque", bs::BuiltinShader::ParticlesLitOpaque);
967 
969  "BuiltinShader", "Decal", bs::BuiltinShader::Decal);
970 
971  if(engine->SetDefaultNamespace("bs") < 0) {
973  }
974 
975  if(!RegisterBSFShandleType<bs::HShader, bs::Shader>("HShader", engine))
976  return false;
977 
978  if(engine->RegisterObjectBehaviour("HShader", asBEHAVE_CONSTRUCT,
979  "void f(const string &in name)", asFUNCTION(ShaderFromNameFactory),
980  asCALL_CDECL_OBJFIRST) < 0) {
982  }
983 
984  if(engine->RegisterObjectBehaviour("HShader", asBEHAVE_CONSTRUCT,
985  "void f(BuiltinShader type)", asFUNCTION(ShaderFromType),
986  asCALL_CDECL_OBJFIRST) < 0) {
988  }
989 
990  if(!RegisterBSFShandleType<bs::HMaterial, bs::Material>("HMaterial", engine))
991  return false;
992 
993  if(engine->RegisterObjectBehaviour("HMaterial", asBEHAVE_CONSTRUCT,
994  "void f(const HShader &in shader)", asFUNCTION(MaterialFromShaderFactory),
995  asCALL_CDECL_OBJFIRST) < 0) {
997  }
998 
999  if(engine->RegisterObjectMethod("HMaterial",
1000  "void setTexture(const string &in name, const HTexture &in texture)",
1001  asFUNCTION(MaterialSetTextureProxy), asCALL_CDECL_OBJFIRST) < 0) {
1003  }
1004 
1005  if(engine->RegisterObjectMethod("HMaterial",
1006  "void setVec4(const string &in name, const Vector4 &in value)",
1007  asFUNCTION(MaterialSetVec44Proxy), asCALL_CDECL_OBJFIRST) < 0) {
1009  }
1010 
1011 
1012 
1013  return true;
1014 }
void MaterialSetVec44Proxy(bs::HMaterial &self, const std::string &name, const bs::Vector4 &value)
Definition: BSFBind.cpp:173
#define ANGELSCRIPT_REGISTER_ENUM_VALUE_WITH_NAME(enum, valuename, x)
Definition: BindHelpers.h:114
void ShaderFromType(void *memory, bs::BuiltinShader type)
Definition: BSFBind.cpp:244
void MaterialSetTextureProxy(bs::HMaterial &self, const std::string &name, const bs::HTexture &texture)
Definition: BSFBind.cpp:161
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12
void MaterialFromShaderFactory(void *memory, const bs::HShader &shader)
Definition: BSFBind.cpp:256
void ShaderFromNameFactory(void *memory, const std::string &name)
Definition: BSFBind.cpp:231

◆ BindMathOperations()

bool Leviathan::BindMathOperations ( asIScriptEngine *  engine)

Definition at line 64 of file BindStandardFunctions.cpp.

65 {
66 
67  // ------------------------------------ //
68  // min
69  if(engine->RegisterGlobalFunction(
70  "const float & min(const float &in a, const float &in b)",
71  asFUNCTIONPR(std::min<float>, (const float&, const float&), const float&),
72  asCALL_CDECL) < 0) {
73 
75  }
76 
77  if(engine->RegisterGlobalFunction(
78  "const int64 & min(const int64 &in a, const int64 &in b)",
79  asFUNCTIONPR(std::min<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
80  asCALL_CDECL) < 0) {
81 
83  }
84 
85  // ------------------------------------ //
86  // max
87  if(engine->RegisterGlobalFunction(
88  "const float & max(const float &in a, const float &in b)",
89  asFUNCTIONPR(std::max<float>, (const float&, const float&), const float&),
90  asCALL_CDECL) < 0) {
91 
93  }
94 
95  if(engine->RegisterGlobalFunction(
96  "const int64 & max(const int64 &in a, const int64 &in b)",
97  asFUNCTIONPR(std::max<int64_t>, (const int64_t&, const int64_t&), const int64_t&),
98  asCALL_CDECL) < 0) {
99 
101  }
102 
103  // ------------------------------------ //
104  // round
105  if(engine->RegisterGlobalFunction(
106  "int round(double value)", asFUNCTION(RoundProxy), asCALL_CDECL) < 0) {
107 
109  }
110  if(engine->RegisterGlobalFunction(
111  "int round(float value)", asFUNCTION(RoundProxy2), asCALL_CDECL) < 0) {
112 
114  }
115 
116  // ------------------------------------ //
117  // sign
118  if(engine->RegisterGlobalFunction(
119  "float sign(float value)", asFUNCTION(SignProxy), asCALL_CDECL) < 0) {
120 
122  }
123 
124  // ------------------------------------ //
125  // clamp
126  if(engine->RegisterGlobalFunction("const float & clamp(const float &in value, const float "
127  "&in lower, const float &in upper)",
128  asFUNCTIONPR(
129  std::clamp<float>, (const float&, const float&, const float&), const float&),
130  asCALL_CDECL) < 0) {
131 
133  }
134 
135  // ------------------------------------ //
136  // Extra string helpers
137  if(engine->RegisterGlobalFunction("string CharacterToString(int32 character)",
138  asFUNCTION(CharacterToStringProxy), asCALL_CDECL) < 0) {
139 
141  }
142 
143 
144  return true;
145 }
float SignProxy(float value)
std::string CharacterToStringProxy(int32_t character)
int RoundProxy(double value)
int RoundProxy2(float value)
#define ANGELSCRIPT_REGISTERFAIL
Definition: BindHelpers.h:12

◆ BindMatrix4()

bool Leviathan::BindMatrix4 ( asIScriptEngine *  engine)

Definition at line 525 of file BSFBind.cpp.

526 {