#![allow(
dead_code,
unused_imports,
unused_variables,
non_upper_case_globals,
clippy::all,
clippy::pedantic,
clippy::nursery
)]
pub trait LuaObject {}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct LuaAny;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct LuaStorage;
impl LuaStorage {
#[must_use]
pub const fn new() -> Self {
Self
}
}
impl From<LuaStorage> for LuaAny {
fn from(_: LuaStorage) -> Self {
LuaAny
}
}
impl std::ops::Index<&str> for LuaStorage {
type Output = LuaAny;
fn index(&self, _key: &str) -> &LuaAny {
&LUA_ANY
}
}
const LUA_ANY: LuaAny = LuaAny;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct Serpent;
impl Serpent {
#[must_use]
pub const fn new() -> Self {
Self
}
#[allow(unused_variables)]
pub fn block(&self, value: impl Into<LuaAny>) -> &'static str {
""
}
#[allow(unused_variables)]
pub fn line(&self, value: impl Into<LuaAny>) -> &'static str {
""
}
#[allow(unused_variables)]
pub fn dump(&self, value: impl Into<LuaAny>) -> &'static str {
""
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct LuaFunction;
impl LuaFunction {
#[must_use]
pub const fn new() -> Self {
Self
}
}
impl From<LuaFunction> for LuaAny {
fn from(_: LuaFunction) -> Self {
LuaAny
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct LocalisedString;
impl From<LocalisedString> for LuaAny {
fn from(_: LocalisedString) -> Self {
LuaAny
}
}
impl<'a> From<&'a str> for LocalisedString {
fn from(_: &'a str) -> Self {
Self
}
}
impl From<String> for LocalisedString {
fn from(_: String) -> Self {
Self
}
}
impl<'a, const N: usize> From<[&'a str; N]> for LocalisedString {
fn from(_: [&'a str; N]) -> Self {
Self
}
}
impl<R> From<fn() -> R> for LuaFunction {
fn from(_: fn() -> R) -> Self {
LuaFunction
}
}
impl<A, R> From<fn(A) -> R> for LuaFunction {
fn from(_: fn(A) -> R) -> Self {
LuaFunction
}
}
impl<A, B, R> From<fn(A, B) -> R> for LuaFunction {
fn from(_: fn(A, B) -> R) -> Self {
LuaFunction
}
}
impl<A, B, C, R> From<fn(A, B, C) -> R> for LuaFunction {
fn from(_: fn(A, B, C) -> R) -> Self {
LuaFunction
}
}
impl<A, B, C, D, R> From<fn(A, B, C, D) -> R> for LuaFunction {
fn from(_: fn(A, B, C, D) -> R) -> Self {
LuaFunction
}
}
#[must_use]
pub fn lua_fn<F, A, R>(_f: F) -> LuaFunction
where
F: Fn(A) -> R,
{
LuaFunction
}
#[must_use]
pub fn lua_fn0<F, R>(_f: F) -> LuaFunction
where
F: Fn() -> R,
{
LuaFunction
}
#[must_use]
pub fn lua_fn2<F, A, B, R>(_f: F) -> LuaFunction
where
F: Fn(A, B) -> R,
{
LuaFunction
}
pub trait IntoOptionalLuaFunction {
fn into_optional_lua_function(self) -> Option<LuaFunction>;
}
impl IntoOptionalLuaFunction for LuaFunction {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self)
}
}
impl IntoOptionalLuaFunction for Option<LuaFunction> {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
self
}
}
impl<R> IntoOptionalLuaFunction for fn() -> R {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self.into())
}
}
impl<A, R> IntoOptionalLuaFunction for fn(A) -> R {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self.into())
}
}
impl<A, B, R> IntoOptionalLuaFunction for fn(A, B) -> R {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self.into())
}
}
impl<A, B, C, R> IntoOptionalLuaFunction for fn(A, B, C) -> R {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self.into())
}
}
impl<A, B, C, D, R> IntoOptionalLuaFunction for fn(A, B, C, D) -> R {
fn into_optional_lua_function(self) -> Option<LuaFunction> {
Some(self.into())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum IndexOrName {
Index(u32),
Name(&'static str),
}
impl Default for IndexOrName {
fn default() -> Self {
Self::Index(0)
}
}
impl From<u32> for IndexOrName {
fn from(value: u32) -> Self {
Self::Index(value)
}
}
impl From<&'static str> for IndexOrName {
fn from(value: &'static str) -> Self {
Self::Name(value)
}
}
impl From<IndexOrName> for LuaAny {
fn from(_: IndexOrName) -> Self {
LuaAny
}
}
impl<'a> From<&'a str> for LuaAny {
fn from(_: &'a str) -> Self {
LuaAny
}
}
impl From<String> for LuaAny {
fn from(_: String) -> Self {
LuaAny
}
}
impl From<bool> for LuaAny {
fn from(_: bool) -> Self {
LuaAny
}
}
impl From<u8> for LuaAny {
fn from(_: u8) -> Self {
LuaAny
}
}
impl From<u16> for LuaAny {
fn from(_: u16) -> Self {
LuaAny
}
}
impl From<u32> for LuaAny {
fn from(_: u32) -> Self {
LuaAny
}
}
impl From<u64> for LuaAny {
fn from(_: u64) -> Self {
LuaAny
}
}
impl From<i8> for LuaAny {
fn from(_: i8) -> Self {
LuaAny
}
}
impl From<i16> for LuaAny {
fn from(_: i16) -> Self {
LuaAny
}
}
impl From<i32> for LuaAny {
fn from(_: i32) -> Self {
LuaAny
}
}
impl From<i64> for LuaAny {
fn from(_: i64) -> Self {
LuaAny
}
}
impl From<f32> for LuaAny {
fn from(_: f32) -> Self {
LuaAny
}
}
impl From<f64> for LuaAny {
fn from(_: f64) -> Self {
LuaAny
}
}
impl From<usize> for LuaAny {
fn from(_: usize) -> Self {
LuaAny
}
}
impl From<crate::concepts::MapPosition> for LuaAny {
fn from(_: crate::concepts::MapPosition) -> Self {
LuaAny
}
}
impl From<crate::concepts::BoundingBox> for LuaAny {
fn from(_: crate::concepts::BoundingBox) -> Self {
LuaAny
}
}
impl From<crate::concepts::Color> for LuaAny {
fn from(_: crate::concepts::Color) -> Self {
LuaAny
}
}
impl std::ops::Index<&str> for LuaAny {
type Output = crate::settings::ModSettingValue;
fn index(&self, _key: &str) -> &Self::Output {
&crate::settings::UNIT_MOD_SETTING
}
}
impl LuaAny {
pub fn x(self) -> f64 {
0.0
}
pub fn y(self) -> f64 {
0.0
}
pub fn left_top(self) -> LuaAny {
LuaAny
}
pub fn right_bottom(self) -> LuaAny {
LuaAny
}
pub fn value(self) -> LuaAny {
LuaAny
}
}
pub trait SettingValue: Copy + 'static {
const STUB: Self;
}
impl SettingValue for bool {
const STUB: Self = false;
}
impl SettingValue for u8 {
const STUB: Self = 0;
}
impl SettingValue for u16 {
const STUB: Self = 0;
}
impl SettingValue for u32 {
const STUB: Self = 0;
}
impl SettingValue for u64 {
const STUB: Self = 0;
}
impl SettingValue for usize {
const STUB: Self = 0;
}
impl SettingValue for i8 {
const STUB: Self = 0;
}
impl SettingValue for i16 {
const STUB: Self = 0;
}
impl SettingValue for i32 {
const STUB: Self = 0;
}
impl SettingValue for i64 {
const STUB: Self = 0;
}
impl SettingValue for f32 {
const STUB: Self = 0.0;
}
impl SettingValue for f64 {
const STUB: Self = 0.0;
}
impl SettingValue for &'static str {
const STUB: Self = "";
}
impl LuaAny {
pub const fn get<T: SettingValue>(&self, _key: &str) -> T {
T::STUB
}
}
include!(concat!(env!("OUT_DIR"), "/mod.rs"));
pub mod lua_libs;
pub mod settings;
pub use event_filters::{EventFilterEntry, FilterMethodSpec, filter_method_spec};
pub use lua_libs::{LuaMath, LuaStringLib, LuaTableLib};
pub use map::{event_filter_type, event_type_to_name};
pub use unions::literal_enum_variant_str;
pub mod prelude {
pub use crate::LocalisedString;
pub use crate::SettingValue;
pub use crate::concepts::*;
pub use crate::event_data::*;
pub use crate::event_filters::*;
pub use crate::event_type_to_name;
pub use crate::events::*;
pub use crate::globals::*;
pub use crate::lua_fn;
pub use crate::lua_fn0;
pub use crate::lua_fn2;
pub use crate::settings::{
BoolSetting, DoubleSetting, IntSetting, ModSettingValue, StringSetting, data, settings,
};
pub use crate::unions::*;
}