Esempio n. 1
0
 public GameBase(LNBase p)
 {
     Loaded  = false;
     Parent  = p;
     Scenes  = new SceneHandler(this);
     Started = false;
     AUTH    = false;
 }
Esempio n. 2
0
 /// <summary>
 /// Set to defualt behaviour of a scene (show at once)
 /// </summary>
 /// <param name="sh">SceneHandler to access other scenes</param>
 public SceneBehaviour(SceneHandler sh)
 {
     Period = 0;
     Parent = sh;
     Before = () => { };
     After  = () => { };
     Update = (int cycle, SceneValues sv) => {
         sv.SetVisible(sv.FullLength);
         return(true);
     };
     Reset( );
 }
Esempio n. 3
0
            /// <summary>
            /// Set behaviour of given scene
            /// </summary>
            /// <param name="sh">SceneHandler to be able toaccess other scenes</param>
            /// <param name="updatepace">Spped in ms of update function</param>
            /// <param name="upt">Update function. If returns true, scene ends</param>
            /// <param name="aft">Function after </param>
            /// <param name="bef"></param>
            public SceneBehaviour(SceneHandler sh,
                                  int updatepace = 100,
                                  Func <int, SceneValues, bool> upt = null,
                                  Action aft = null,
                                  Action bef = null
                                  )
            {
                Parent = sh;
                Period = updatepace;
                if (upt == null)
                {
                    upt = (int c, SceneValues sv) => {
                        if (c < sv.FullLength)
                        {
                            sv.SetVisible(c);
                            return(false);                                          // continue;
                        }
                        sv.SetVisible(sv.FullLength);
                        return(true);                                           // break;
                    }
                }
                ;
                if (aft == null)
                {
                    aft = () => { }
                }
                ;
                if (bef == null)
                {
                    bef = () => { }
                }
                ;

                Before = bef;
                Update = upt;
                After  = aft;

                Reset( );
            }