[gnome-nibbles/arnaudb/use-uint8: 26/33] Privatize some classes to NibblesView.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/use-uint8: 26/33] Privatize some classes to NibblesView.
- Date: Thu, 9 Jul 2020 15:14:50 +0000 (UTC)
commit bb66f26634f43e85d9a705e8de05fa93f218a067
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Thu Jul 2 16:47:04 2020 +0200
Privatize some classes to NibblesView.
src/nibbles-view.vala | 146 +++++++++++++++++++++++++-------------------------
1 file changed, 73 insertions(+), 73 deletions(-)
---
diff --git a/src/nibbles-view.vala b/src/nibbles-view.vala
index 6dc61d8..7074a8e 100644
--- a/src/nibbles-view.vala
+++ b/src/nibbles-view.vala
@@ -16,100 +16,100 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-private class WormActor : Clutter.Actor
+private class NibblesView : GtkClutter.Embed
{
- protected override void show ()
+ private class WormActor : Clutter.Actor
{
- base.show ();
+ protected override void show ()
+ {
+ base.show ();
- set_opacity (0);
- set_scale (3.0, 3.0);
+ set_opacity (0);
+ set_scale (3.0, 3.0);
+
+ save_easing_state ();
+ set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
+ set_easing_duration (GAMEDELAY * 26);
+ set_scale (1.0, 1.0);
+ set_pivot_point (0.5f, 0.5f);
+ set_opacity (0xff);
+ restore_easing_state ();
+ }
- save_easing_state ();
- set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
- set_easing_duration (NibblesView.GAMEDELAY * 26);
- set_scale (1.0, 1.0);
- set_pivot_point (0.5f, 0.5f);
- set_opacity (0xff);
- restore_easing_state ();
+ protected override void hide ()
+ {
+ save_easing_state ();
+ set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
+ set_easing_duration (GAMEDELAY * 15);
+ set_scale (0.4f, 0.4f);
+ set_opacity (0);
+ restore_easing_state ();
+ }
}
- protected override void hide ()
+ private class BonusTexture : GtkClutter.Texture
{
- save_easing_state ();
- set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
- set_easing_duration (NibblesView.GAMEDELAY * 15);
- set_scale (0.4f, 0.4f);
- set_opacity (0);
- restore_easing_state ();
- }
-}
+ private const float SIZE_MULTIPLIER = 2;
-private class BonusTexture : GtkClutter.Texture
-{
- private const float SIZE_MULTIPLIER = 2;
+ protected override void show ()
+ {
+ base.show ();
- protected override void show ()
- {
- base.show ();
+ set_opacity (0);
+ set_scale (3.0, 3.0);
- set_opacity (0);
- set_scale (3.0, 3.0);
+ save_easing_state ();
+ set_easing_mode (Clutter.AnimationMode.EASE_OUT_BOUNCE);
+ set_easing_duration (GAMEDELAY * 20);
+ set_scale (1.0, 1.0);
+ set_pivot_point (0.5f, 0.5f);
+ set_opacity (0xff);
+ restore_easing_state ();
+ }
- save_easing_state ();
- set_easing_mode (Clutter.AnimationMode.EASE_OUT_BOUNCE);
- set_easing_duration (NibblesView.GAMEDELAY * 20);
- set_scale (1.0, 1.0);
- set_pivot_point (0.5f, 0.5f);
- set_opacity (0xff);
- restore_easing_state ();
+ internal new void set_size (float width, float height)
+ {
+ base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
+ }
}
- internal new void set_size (float width, float height)
+ private class WarpTexture: GtkClutter.Texture
{
- base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
- }
-}
+ private const float SIZE_MULTIPLIER = 2;
-private class WarpTexture: GtkClutter.Texture
-{
- private const float SIZE_MULTIPLIER = 2;
-
- protected override void show ()
- {
- base.show ();
+ protected override void show ()
+ {
+ base.show ();
- set_opacity (0);
- set_scale (3.0, 3.0);
+ set_opacity (0);
+ set_scale (3.0, 3.0);
- save_easing_state ();
- set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
- set_easing_duration (NibblesView.GAMEDELAY * 15);
- set_scale (1.0, 1.0);
- set_pivot_point (0.5f, 0.5f);
- set_opacity (0xff);
- restore_easing_state ();
- }
+ save_easing_state ();
+ set_easing_mode (Clutter.AnimationMode.EASE_OUT_CIRC);
+ set_easing_duration (GAMEDELAY * 15);
+ set_scale (1.0, 1.0);
+ set_pivot_point (0.5f, 0.5f);
+ set_opacity (0xff);
+ restore_easing_state ();
+ }
- protected override void hide ()
- {
- save_easing_state ();
- set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
- set_easing_duration (NibblesView.GAMEDELAY * 15);
- set_scale (0.4f, 0.4f);
- set_pivot_point (0.5f, 0.5f);
- set_opacity (0);
- restore_easing_state ();
- }
+ protected override void hide ()
+ {
+ save_easing_state ();
+ set_easing_mode (Clutter.AnimationMode.EASE_IN_QUAD);
+ set_easing_duration (GAMEDELAY * 15);
+ set_scale (0.4f, 0.4f);
+ set_pivot_point (0.5f, 0.5f);
+ set_opacity (0);
+ restore_easing_state ();
+ }
- internal new void set_size (float width, float height)
- {
- base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
+ internal new void set_size (float width, float height)
+ {
+ base.set_size (SIZE_MULTIPLIER * width, SIZE_MULTIPLIER * height);
+ }
}
-}
-private class NibblesView : GtkClutter.Embed
-{
internal const int WIDTH = 92;
internal const int HEIGHT = 66;
internal const int GAMEDELAY = 35;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]