Beispiel #1
0
 public LogicEventHandler(int cell, Action <int> on_value_changed, Action <int, bool> on_connection_changed, LogicPortSpriteType sprite_type)
 {
     this.cell           = cell;
     onValueChanged      = on_value_changed;
     onConnectionChanged = on_connection_changed;
     spriteType          = sprite_type;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a logic port, in a method compatible with both the new and old Automation
 /// updates. The port will have the default strings which fit well with the
 /// LogicOperationalController.
 /// </summary>
 /// <returns>A logic port compatible with both editions.</returns>
 public static LogicPorts.Port CompatLogicPort(LogicPortSpriteType type,
                                               CellOffset offset)
 {
     return(new LogicPorts.Port(LogicOperationalController.PORT_ID, offset,
                                STRINGS.UI.LOGIC_PORTS.CONTROL_OPERATIONAL,
                                STRINGS.UI.LOGIC_PORTS.CONTROL_OPERATIONAL_ACTIVE,
                                STRINGS.UI.LOGIC_PORTS.CONTROL_OPERATIONAL_INACTIVE, false, type));
 }
 public LogicEventSender(HashedString id, int cell, Action <int> on_value_changed, Action <int, bool> on_connection_changed, LogicPortSpriteType sprite_type)
 {
     this.id             = id;
     this.cell           = cell;
     onValueChanged      = on_value_changed;
     onConnectionChanged = on_connection_changed;
     spriteType          = sprite_type;
 }
Beispiel #4
0
 public Port(HashedString id, CellOffset cell_offset, string description, string activeDescription, string inactiveDescription, bool show_wire_missing_icon, LogicPortSpriteType sprite_type, bool display_custom_name = false)
 {
     this.id                  = id;
     cellOffset               = cell_offset;
     this.description         = description;
     this.activeDescription   = activeDescription;
     this.inactiveDescription = inactiveDescription;
     requiresConnection       = show_wire_missing_icon;
     spriteType               = sprite_type;
     displayCustomName        = display_custom_name;
 }
Beispiel #5
0
 public LogicPortVisualizer(int cell, LogicPortSpriteType sprite_type)
 {
     this.cell  = cell;
     spriteType = sprite_type;
 }
Beispiel #6
0
        private static object CreateLogicEventHandler(int cell, Action <int> on_value_changed, Action <int, bool> on_connection_changed, LogicPortSpriteType sprite_type)
        {
            Type logicEventHandlerType = typeof(LogicGate).Assembly.GetType("LogicEventHandler");

            return(Activator.CreateInstance(logicEventHandlerType, cell, on_value_changed, on_connection_changed, sprite_type));
        }