Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Properties | List of all members
Smooth.Compare.Configuration Class Reference

Public Member Functions

virtual Option< IComparer< T > > Comparer< T > ()
 If JIT is enabled, this method is called by the finder when it is asked to supply a sort order comparer for an unregistered, non-IComparable<T> type. More...
 
 Configuration ()
 
virtual Option
< IEqualityComparer< T > > 
EqualityComparer< T > ()
 If JIT is enabled, this method is called by the finder when it is asked to supply an equality comparer for an unregistered, non-IEquatable<T> type.. More...
 
virtual void HandleFinderEvent (ComparerType comparerType, EventType eventType, Type type)
 Listens for finder events which are useful for finding potential comparison problems. More...
 
virtual void RegisterComparers ()
 Method called by the finder to set up registrations before any comparer requests are handled. More...
 

Static Public Member Functions

static int Color32ToInt (Color32 c)
 Converts a 32-bit color to a 32-bit integer without loss of information More...
 

Properties

bool NoJit [get]
 Convenience method for !UseJit. More...
 
virtual bool UseJit [get]
 This can be used to override the platform setting and enable or disable automatic comparer creation, which can be quite useful while testing in different environments. More...
 

Detailed Description

Configuration class for Smooth.Compare.

To supply a custom configuration, simply add a class to your project called Smooth.Compare.CustomConfiguration that inherits from this type.

If a custom configuration exists, it will override the the default configuration.

Note: Don't edit this class directly, as it may get updated in future versions of Smooth.Compare.

Constructor & Destructor Documentation

Smooth.Compare.Configuration.Configuration ( )
inline

Default constructor that simply adds a listener to Finder.OnEvent.

If you supply a custom configuration, don't register types or do any comparsions from the constructor as the finder will not be fully initialized yet.

Member Function Documentation

static int Smooth.Compare.Configuration.Color32ToInt ( Color32  c)
inlinestatic

Converts a 32-bit color to a 32-bit integer without loss of information

virtual Option<IComparer<T> > Smooth.Compare.Configuration.Comparer< T > ( )
inlinevirtual

If JIT is enabled, this method is called by the finder when it is asked to supply a sort order comparer for an unregistered, non-IComparable<T> type.

If you want to write custom comparers using reflection, you can do so by overriding this method.

Returns
An option containing a sort order comparer for type T, or None to use the default comparer
virtual Option<IEqualityComparer<T> > Smooth.Compare.Configuration.EqualityComparer< T > ( )
inlinevirtual

If JIT is enabled, this method is called by the finder when it is asked to supply an equality comparer for an unregistered, non-IEquatable<T> type..

If you want to write custom equality comparers using reflection, you can do so by overriding this method.

Returns
An option containing an equality comparer for type T, or None to use the default comparer
virtual void Smooth.Compare.Configuration.HandleFinderEvent ( ComparerType  comparerType,
EventType  eventType,
Type  type 
)
inlinevirtual

Listens for finder events which are useful for finding potential comparison problems.

The default implementation logs warnings on registration collisions, the use of inefficient or invalid comparers, and unregistered find requests for value types if JIT is disabled.

virtual void Smooth.Compare.Configuration.RegisterComparers ( )
inlinevirtual

Method called by the finder to set up registrations before any comparer requests are handled.

If you supply a custom configuration and want to apply the default registrations, add a call to base.RegisterComparers() from your method override.

Property Documentation

bool Smooth.Compare.Configuration.NoJit
get

Convenience method for !UseJit.

virtual bool Smooth.Compare.Configuration.UseJit
get

This can be used to override the platform setting and enable or disable automatic comparer creation, which can be quite useful while testing in different environments.


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