note description: "GAME_HAPTIC_EFFECT that play at a custom strength." author: "Louis Marchand" date: "Tue, 03 Mar 2015 14:16:22 +0000" revision: "2.0" class interface GAME_HAPTIC_CUSTOM_EFFECT create make feature -- Initialization make -- Initialization of Current ensure then axes_number_valid: axes_count >= 1 type_valid: type.to_natural_32 = {GAME_SDL_EXTERNAL}.sdl_haptic_custom feature -- Access direction: GAME_HAPTIC_DIRECTION assign set_direction -- The orientation that the force of Current come from require exists: exists set_direction (a_direction: GAME_HAPTIC_DIRECTION) -- assign direction with the values of a_direction require exists: exists ensure is_assign: direction ~ a_direction length: NATURAL_32 assign set_length -- Duration of Current (in millisecond) set_length (a_length: NATURAL_32) -- Assign length with the value of a_length delay: NATURAL_16 assign set_delay -- delay before starting Current (in millisecond) set_delay (a_delay: NATURAL_16) -- Assign delay with the value of a_delay interval: NATURAL_16 assign set_interval -- how soon before effect can be triggered again (in millisecond) set_interval (a_interval: NATURAL_16) -- Assign interval with the value of a_interval axes_count: NATURAL_8 assign set_axes_number -- The number of axes to use require exists: exists set_axes_count (a_count: NATURAL_8) -- Assign axes_count with the value of a_count -- Note: Callig this routine will clear the samples (to satisfied invariant) require exists: exists number_valid: a_count >= 1 ensure is_assign: axes_count = a_count samples_valid_for_every_axes: samples.count.divisible (axes_count.to_integer_32) period: NATURAL_16 assign set_period -- Time (in millisecond) between two samples. require exists: exists set_period (a_period: NATURAL_16) -- Assign period with the value of a_period require exists: exists period_valid: a_period <= 32767 ensure is_assign: period = a_period samples: ARRAYED_LIST [NATURAL_16] assign set_samples -- Value sequence to play Current require exists: exists set_samples (a_samples: ARRAYED_LIST [NATURAL_16]) -- Assign samples with the values in a_samples require exists: exists samples_for_all_axes: a_samples.count.divisible (axes_count.to_integer_32) ensure is_assign: samples ~ a_samples samples_valid_for_every_axes: samples.count.divisible (axes_count.to_integer_32) fade_in_level: NATURAL_16 assign set_fade_in_level -- level at the start of the fade in set_fade_in_level (a_fade_in_level: NATURAL_16) -- Assign fade_in_level with the value of a_fade_in_level fade_in_length: NATURAL_16 assign set_fade_in_length -- length of the fade in set_fade_in_length (a_fade_in_length: NATURAL_16) -- Assign fade_in_length with the value of a_fade_in_length fade_out_level: NATURAL_16 assign set_fade_out_level -- level at the start of the fade out set_fade_out_level (a_fade_out_level: NATURAL_16) -- Assign fade_out_level with the value of a_fade_out_level fade_out_length: NATURAL_16 assign set_fade_out_length -- length of the fade out set_fade_out_length (a_fade_out_length: NATURAL_16) -- Assign fade_out_length with the value of a_fade_out_length feature -- Implementation dispose -- Action to be executed just before garbage collection -- reclaims an object. -- Effect it in descendants to perform specific dispose -- actions. Those actions should only take care of freeing -- external resources; they should not perform remote calls -- on other objects since these may also be dead and reclaimed. invariant axes_number_valid: axes_count >= 1 samples_valid_for_every_axes: samples.count.divisible (axes_count.to_integer_32) end -- class GAME_HAPTIC_CUSTOM_EFFECT
Generated by ISE EiffelStudio