Пример #1
0
 public Sample(string name, int startFrame, int endFrame, PlayMode playMode)
 {
     this.name = name;
     this.startTime = (startFrame - 1) / animationFPS;
     this.endTime = (endFrame - 1) / animationFPS;
     this.playMode = playMode;
 }
Пример #2
0
 /// <summary>
 /// Constructor which gets all data
 /// </summary>
 /// <param name="name">Extension</param>
 /// <param name="playMode">PlayMode</param>
 /// <param name="arguments">Arguments</param>
 /// <param name="extPlayerUse">Use in external player</param>
 public ExtensionSettings(String name, PlayMode playMode, String arguments, bool extPlayerUse)
 {
     Name = name;
       PlayMode = playMode;
       Arguments = arguments;
       ExtPlayerUse = extPlayerUse;
 }
Пример #3
0
 public Sample(string name, float startTime, float endTime, PlayMode playMode)
 {
     this.name = name;
     this.startTime = startTime;
     this.endTime = endTime;
     this.playMode = playMode;
 }
Пример #4
0
 public override void OnReset()
 {
     targetGameObject = null;
     animationName.Value = "";
     fadeLength = 0.3f;
     playMode = PlayMode.StopSameLayer;
 }
Пример #5
0
 public Game(string filename, PlayMode playMode, int top, int left, int mgotop, int mgoleft)
     : this(filename, playMode, mgotop, mgoleft)
 {
     this.top = top;
     this.left = left;
     this.FormBorderStyle = FormBorderStyle.None;
 }
 public override void OnReset()
 {
     if (animationName != null) {
         animationName.Value = "";
     }
     playMode = PlayMode.StopSameLayer;
 }
        /// <summary>
        /// Will start animation with name animation. The animation will be played abruptly without any blending.<br/>
        /// </summary>
        /// <param name="name">The name of animation clip you want to play.</param>
        /// <param name="mode">How the other animations will stopped?</param>
        /// <returns>Will return false if animation can't be played (no animation clip).</returns>
        /// <remarks>
        /// If mode is PlayMode.StopSameLayer then all animations in the same layer will be stopped. If mode is PlayMode.StopAll then all animations currently playing will be stopped.<br/>
        /// If the animation is already playing, other animations will be stopped but the animation will not rewind to the beginning.<br/>
        /// If the animation is not set to be looping it will be stopped and rewinded after playing.<br/>
        /// </remarks>
        public bool Play(string name, PlayMode mode)
        {
            SpriteAnimationState state = this[name];
            if (state != null)
            {
                //stop other state with playmode
                {
                    if (mode == PlayMode.StopAll)
                        StopAllExcept(state);
                    else
                        StopLayerExcept(state.layer, state);
                }


                if (state.enabled)
                    return true;


                state.lastTime = state.time = state.speed > 0 ? 0f : state.length;
                state.weight = 1f;
                state.enabled = true;

                state.lastFrameIndex = -1;
                state.lastEvaluateTime = 0;


                return true;
            }

            
            return false;
        }
        /// <summary>
        /// Will start the default animation. The animation will be played abruptly without any blending.<br/>
        /// </summary>
        /// <param name="mode">How the other animations will stopped?</param>
        /// <returns>Will return false if animation can't be played (no default animation).</returns>
        /// <remarks>
        /// If mode is PlayMode.StopSameLayer then all animations in the same layer will be stopped. If mode is PlayMode.StopAll then all animations currently playing will be stopped.<br/>
        /// If the animation is already playing, other animations will be stopped but the animation will not rewind to the beginning.<br/>
        /// If the animation is not set to be looping it will be stopped and rewinded after playing.<br/>
        /// </remarks>
        public bool Play(PlayMode mode)
        {
            if ( clip == null )
                return false;

            return Play(clip.name, mode);
        }
        /// <summary>
        /// Will start animation with name animation. The animation will be played abruptly without any blending.<br/>
        /// </summary>
        /// <param name="name">The name of animation clip you want to play.</param>
        /// <param name="mode">How the other animations will stopped?</param>
        /// <returns>Will return false if animation can't be played (no animation clip).</returns>
        /// <remarks>
        /// If mode is PlayMode.StopSameLayer then all animations in the same layer will be stopped. If mode is PlayMode.StopAll then all animations currently playing will be stopped.<br/>
        /// If the animation is already playing, other animations will be stopped but the animation will not rewind to the beginning.<br/>
        /// If the animation is not set to be looping it will be stopped and rewinded after playing.<br/>
        /// </remarks>
        public bool Play(string name, PlayMode mode)
        {
            SpriteAnimationState state = this[name];
            if (state != null)
            {
                if (mode == PlayMode.StopAll)
                    StopAll();
                else
                    StopLayer(state.layer);

                if (state.enabled)
                    return true;

                state.time = 0f;
                state.weight = 1f;
                state.enabled = true;

                state.lastTime = 0f;
                state.lastFrameIndex = -1;
                state.lastEvaluateTime = 0;

                return true;
            }

            return false;
        }
Пример #10
0
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     animationName = new ConcreteStringVar();
     fadeLength = .3f;
     queue = QueueMode.CompleteOthers;
     playMode = PlayMode.StopSameLayer;
 }
Пример #11
0
 public override void OnReset()
 {
     targetGameObject = null;
     animationName.Value = "";
     queue = QueueMode.CompleteOthers;
     playMode = PlayMode.StopSameLayer;
 }
 public override void OnReset()
 {
     if (animationName != null) {
         animationName.Value = "";
     }
     queue = QueueMode.CompleteOthers;
     playMode = PlayMode.StopSameLayer;
 }
Пример #13
0
        // new world with the editor
        private World(PlayMode playMode)
        {
            this.PlayMode = playMode;
            this.viewport = new GamePoint(0, 0);

            if (playMode == PlayMode.Editor)
                mainGameObject = new NullMGO();
        }
Пример #14
0
 public override void Reset()
 {
     gameObject = null;
     animName = null;
     playMode = PlayMode.StopAll;
     blendTime = 0.3f;
     finishEvent = null;
     stopOnExit = false;
 }
Пример #15
0
 // new world with the game
 public World(string filename, Drawing.DrawHandler drawHandler, GameEventHandler aiEventHandler, GameSession session, PlayMode playMode)
     : this(playMode)
 {
     this.DrawHandler = drawHandler;
     this.fileName = filename;
     this.aiEventHandler = aiEventHandler;
     this.session = session;
     Deserialize();
 }
Пример #16
0
        public static Ruleset GetRuleset(PlayMode mode)
        {
            Type type;

            if (!availableRulesets.TryGetValue(mode, out type))
                return null;

            return Activator.CreateInstance(type) as Ruleset;
        }
Пример #17
0
 private void Close_Click(object sender, RoutedEventArgs e)
 {
     Mode = (PlayMode)ModeBox.SelectedItem;
     if (isNameChanged)
         MyName = NameTb.Text;
     else MyName = "WinDev";
     DialogResult = true;
     this.Close();
 }
Пример #18
0
 private FontAwesome getModeIcon(PlayMode mode)
 {
     switch (mode)
     {
         default: return FontAwesome.fa_osu_osu_o;
         case PlayMode.Taiko: return FontAwesome.fa_osu_taiko_o;
         case PlayMode.Catch: return FontAwesome.fa_osu_fruits_o;
         case PlayMode.Mania: return FontAwesome.fa_osu_mania_o;
     }
 }
Пример #19
0
 public ModePicker()
 {
     InitializeComponent();
     foreach (var item in Enum.GetValues(typeof (PlayMode)))
     {
         ModeBox.Items.Add(item);
     }
     ModeBox.SelectedIndex = 0;
     Mode = (PlayMode)ModeBox.SelectedItem;
 }
        public static IEnumerable<IMultiCard> FindRestrictedCards(IEnumerable<IMultiCard> cardsToCheck, PlayMode playMode)
        {
            if (cardsToCheck == null)
            {
                return new List<IMultiCard>();
            }

            return playMode == PlayMode.Standard
                ? cardsToCheck.Where(c => RestrictedCardsStandard.Contains(c.Name.ToUpperInvariant())).ToArray()
                : cardsToCheck.Where(c => RestrictedCardsCataclysm.Contains(c.Name.ToUpperInvariant())).ToArray();
        }
Пример #21
0
 public override void Reset()
 {
     gameObject = null;
     animations = new FsmString[0];
     weights = new FsmFloat[0];
     playMode = PlayMode.StopAll;
     blendTime = 0.3f;
     finishEvent = null;
     loopEvent = null;
     stopOnExit = false;
 }
Пример #22
0
	// Use this for initialization
	void Start() {
		if(PlayerPrefs.HasKey("lastSortMode")) {
			sortMode = (SortMode)PlayerPrefs.GetInt("lastSortMode");
		}
		if(sortMode == SortMode.SearchRelevance) {
			sortMode = SortMode.Alphabetic;
		}
		if(PlayerPrefs.HasKey("lastPlayMode")) {
			mode = (PlayMode)PlayerPrefs.GetInt("lastPlayMode");
		}
	}
Пример #23
0
 public void SetAtlas(int _rowCount ,int _colCount ,int _rowNumber ,int _colNumber)
 {
     canPlay = true;
     playMode = PlayMode.still;
     rowCount = _rowCount;
     colCount = _colCount;
     rowNumber = _rowNumber;
     colNumber = _colNumber;
     totalCells = _colCount * _rowCount;
     fps = 10;
     StartCoroutine("SetSpriteAnimation");
 }
Пример #24
0
    public void SetAtlas(PlayMode _mode,int _rowCount , int _colCount ,int _rowNumber ,int _colNumber,int _totalCells,int _fps )
    {
        canPlay = true;
        playMode = _mode;
        rowCount = _rowCount;
        colCount = _colCount;
        rowNumber = _rowNumber;
        colNumber = _colNumber;
        totalCells = _totalCells;
        fps = _fps;

        StartCoroutine("SetSpriteAnimation");
    }
Пример #25
0
	void ChangeMode ( PlayMode newMode)
	{
		Stop ();
		switch (newMode) 
		{
		case PlayMode.TOCAR:
			Play();
			break;
//		case PlayMode.GRAVAR:
//			Record();
//			break;
		default:
			break;
		}
	}
Пример #26
0
        public World(int gameWindowWidth, int gameWindowHeight,
            int levelWidth, int levelHeight,
            Drawing.DrawHandler drawHandler, PlayMode playMode)
            : this(playMode)
        {
            Settings = new LevelSettings();
            Settings.GameWindowWidth = gameWindowWidth;
            Settings.GameWindowHeight = gameWindowHeight;
            Settings.LevelWidth = levelWidth;
            Settings.LevelHeight = levelHeight;
            this.DrawHandler = drawHandler;

            this.aiEventHandler = GameAI.NullAiEventHandlerMethod;
            enemies = new List<Enemy>();
            stickyelements = new List<StickyElement>();
            movingelements = new List<MovingElement>();
        }
 public MainWindow()
 {
     Loaded += ReadCom;
     InitializeComponent();
     _mediaPlayer.Volume = 0.5;
     VolumeSlider.Value = _mediaPlayer.Volume * 100;
     _state = State.Stop;
     _updateTimer.Tick += UpdateTimerTick;
     _updateTimer.Interval = new TimeSpan(0, 0, 1);
     _updateTimer.IsEnabled = true;
     _updateTimer.Start();
     _screenTimer.Interval = new TimeSpan(TimeSpan.TicksPerSecond / 2 /*4000000*/);
     _screenTimer.IsEnabled = true;
     _screenTimer.Start();
     _screenTimer.Tick += ScreenTimer;
     ElapsedTimeLabel.HorizontalContentAlignment = HorizontalAlignment.Center;
     _playMode = PlayMode.Normal;
 }
Пример #28
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     playMode = PlayMode.OnlineImage;
     playTime = 0;
     UpdateTime();
     timer = new DispatcherTimer();
     timer.Interval = TimeSpan.FromSeconds(1);
     timer.Tick += timer_Tick;
     timer.Stop();
     rand = new Random();
     isGameStarted = false;
     squares = new List<Square>();
     images = new List<Image>();
     InitializeSquares();
     puzzleBoard = new PuzzleBoard(squares);
     SetImageBackgrounds();
 }
Пример #29
0
        public Game(string filename, PlayMode playMode, int mgotop, int mgoleft)
        {
            InitializeComponent();
            SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);

            drawHandler = GetDraw.DrawHandler(this, Update);
            AnimateImage.Refresh = true;
            ignoreSizeChange = false;

            lastModeIsNull = true;
            levelpack = "";

            mgoChangeTop = mgotop;
            mgoChangeLeft = mgoleft;

            started = DateTime.Now;
            StartGame(filename, playMode);
        }
Пример #30
0
 public void SetPlayMode(PlayMode mode)
 {
     _playMode = mode;
     switch (mode)
     {
         case PlayMode.定点开始:
             this.Show();
             cbxYear.Visible = cbxMonth.Visible = cbxDay.Visible = true;
             break;
         case PlayMode.立即开始:
             this.Hide();
             break;
         case PlayMode.定点轮播:
             this.Show();
             cbxYear.Visible = cbxMonth.Visible = cbxDay.Visible = false;
             break;
     }
 }
Пример #31
0
 public IList <ApiScore> GetUserBest(string username, PlayMode mode, int limit = 100)
 {
     return(GetUserScoresResult(GetUserBestURL + "?k=" + ApiKey + "&u=" + username + "&m=" + mode + "&type=string" + "&limit=" + limit));
 }
Пример #32
0
 //PlayModeを設定
 public void SetPlayMode(PlayMode playMode)
 {
     m_nSelectStageNum = 0;
     m_playMode        = playMode;
 }
 public static void Play(this ISPAnim anim, float speed, QueueMode queueMode = QueueMode.PlayNow, PlayMode playMode = PlayMode.StopSameLayer)
 {
     if (anim == null)
     {
         throw new System.ArgumentNullException("anim");
     }
     anim.Speed = speed;
     anim.Play(queueMode, playMode);
 }
Пример #34
0
        public IEnumerable <BeatmapSet> Search(string query,
                                               int amount = 100,
                                               int offset = 0,
                                               BeatmapSetOnlineStatus?rankedStatus = null,
                                               PlayMode mode        = PlayMode.All,
                                               MapSearchType?search = MapSearchType.Normal)
        {
            if (amount > 100 || amount <= -1)
            {
                amount = 100;
            }

            var result = _elasticClient.Search <ElasticBeatmap>(s => // Super complex query to search things. also super annoying
            {
                var ret = s
                          .From(offset)
                          .Size(amount);

                if (search == MapSearchType.Newest || query == string.Empty)
                {
                    ret = ret
                          .MinScore(0)
                          .Aggregations(a => a.Max("ApprovedDate", f => f.Field(v => v.ApprovedDate)));
                }
                else if (search == MapSearchType.TopPlays)
                {
                    ret = ret
                          .MinScore(0)
                          .Aggregations(a => a.Max("TotalPlays", f => f.Field(v => v.TotalPlays)));
                }
                else
                {
                    ret = ret.MinScore(1);
                }

                ret = ret.Query(q =>
                                q.Bool(b => b
                                       .Filter(filter =>
                {
                    QueryContainer res = filter;

                    if (rankedStatus != null)
                    {
                        if (rankedStatus == BeatmapSetOnlineStatus.Ranked ||
                            rankedStatus == BeatmapSetOnlineStatus.Approved)
                        {
                            res = filter.Terms(terms => terms.Field(t => t.RankedStatus).Terms(
                                                   BeatmapSetOnlineStatus.Approved,
                                                   BeatmapSetOnlineStatus.Ranked));
                        }
                        else
                        {
                            res = filter.Term(term => term.Field(p => p.RankedStatus)
                                              .Value(rankedStatus));
                        }
                    }

                    if (mode != PlayMode.All)
                    {
                        res &= filter.Term(term => term.Field(p => p.Mode)
                                           .Value(mode));
                    }

                    return(res);
                })
                                       .Should(should =>
                {
                    if (search == MapSearchType.TopPlays || search == MapSearchType.Newest || query == "")
                    {
                        return(should);
                    }

                    var res =
                        should.Match(match => match.Field(p => p.Creator).Query(query).Boost(2)) ||
                        should.Match(match => match.Field(p => p.Artist).Query(query).Boost(3)) ||
                        should.Match(match => match.Field(p => p.DiffName).Query(query).Boost(1)) ||
                        should.Match(match => match.Field(p => p.Tags).Query(query).Boost(1)) ||
                        should.Match(match => match.Field(p => p.Title).Query(query).Boost(3));

                    return(res);
                }
                                               )
                                       )
                                );

                Logger.LogPrint(_elasticClient.RequestResponseSerializer.SerializeToString(ret, SerializationFormatting.Indented), LoggingTarget.Network, LogLevel.Debug);

                return(ret);
            });

            if (!result.IsValid)
            {
                Logger.LogPrint(result.DebugInformation, LoggingTarget.Network, LogLevel.Important);
                return(null);
            }

            Logger.LogPrint("Query done!");

            var r = new List <BeatmapSet>();

            if (result.Hits.Count > 0)
            {
                lock (_dbContextMutex)
                {
                    var hits =
                        result.Hits
                        .Where(h => h != null)
                        .Select(h => h.Source.Id)
                        .ToList();

                    var dbResult = _dbContext.BeatmapSet.Where(s => hits.Any(h => h == s.SetId))
                                   .Include(o => o.ChildrenBeatmaps);

                    r.AddRange(dbResult);
                }
            }

            Logger.LogPrint("Database done!");

            var sets = new List <BeatmapSet>();

            foreach (var s in r)
            {
                // Fixes an Issue where osu!direct may not load!
                s.Artist  = s.Artist.Replace("|", "");
                s.Title   = s.Title.Replace("|", "");
                s.Creator = s.Creator.Replace("|", "");

                foreach (var bm in s.ChildrenBeatmaps)
                {
                    bm.DiffName = bm.DiffName.Replace("|", "");
                }

                sets.Add(s);
            }

            Logger.LogPrint("Direct Fix done!");

            return(sets);
        }
Пример #35
0
        /// <summary>
        /// Cross fades an animation after previous animations has finished playing.<br/>
        ///If queue is QueueMode.CompleteOthers this animation will only start once all other animations have stopped playing.<br/>
        ///If queue is QueueMode.PlayNow this animation will start playing immediately on a duplicated animation state.<br/>
        /// if mode is PlayMode.StopSameLayer, animations in the same layer as animation will be faded out while animation is faded in. if mode is PlayMode.StopAll, all animations will be faded out while animation is faded in.<br/>
        ///After the animation has finished playing it will automatically clean itself up. Using the duplicated animation state after it has finished will result in an exception. <br/>
        /// </summary>
        /// <param name="name">The clip name that you want to fade in.</param>
        /// <param name="fadeLength">The fade in/out length in second.</param>
        /// <param name="queue">How the clip start fade.</param>
        /// <param name="mode">How to stop the other clips.</param>
        /// <returns>The duplicated animation state of the clip.</returns>
        public SpriteAnimationState CrossFadeQueued(string name, float fadeLength, QueueMode queue, PlayMode mode)
        {
            SpriteAnimationState state = this[name];

            if (state == null)
            {
                return(null);
            }

            bool isPlaying = IsLayerPlaying(state.layer);

            if (queue == QueueMode.PlayNow || !isPlaying)
            {
                string newName = state.name + " - Queued Clone " + cloneID++;

                SpriteAnimationState tmpState = SpriteAnimationState.CreateState();
                tmpState.Clone(state, newName);


                tmpState.removeAfterStop = true;
                AddState(tmpState);

                CrossFade(tmpState, fadeLength, mode);

                return(tmpState);
            }
            else
            {
                string newName = state.name + " - Queued Clone " + cloneID++;

                SpriteAnimationState tmpState = SpriteAnimationState.CreateState();
                tmpState.Clone(state, newName);

                tmpState.removeAfterStop = true;
                AddState(tmpState);


                SpriteAnimationQueueItem item = new SpriteAnimationQueueItem();
                item.state      = tmpState;
                item.playMode   = mode;
                item.fadeLength = fadeLength;
                crossFadeQueue.Add(item);

                return(tmpState);
            }

            return(null);
        }
Пример #36
0
 public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode);
        public ISPAnim CrossFade(string clipId, float fadeLength, QueueMode queueMode = QueueMode.PlayNow, PlayMode playMode = PlayMode.StopSameLayer)
        {
            if (_controller == null)
            {
                throw new AnimationInvalidAccessException();
            }
            var state = this[clipId];

            //if (state == null) throw new UnknownStateException(clipId);
            if (state == null)
            {
                return(null);
            }

            return(state.CrossFade(fadeLength, queueMode, playMode));
        }
 public static void CrossFade(this ISPAnim anim, float speed, float fadeLength, float startTime, QueueMode queueMode = QueueMode.PlayNow, PlayMode playMode = PlayMode.StopSameLayer)
 {
     if (anim == null)
     {
         throw new System.ArgumentNullException("anim");
     }
     anim.Speed = speed;
     anim.CrossFade(fadeLength, queueMode, playMode);
     anim.Time = Mathf.Clamp(startTime, 0f, anim.Duration);
 }
        public ISPAnim CrossFade(float speed, float fadeLength, QueueMode queueMode = QueueMode.PlayNow, PlayMode playMode = PlayMode.StopSameLayer)
        {
            var a = this.CreateAnimatableState();

            if (a != null)
            {
                a.CrossFade(speed, fadeLength, queueMode, playMode);
            }
            return(a);
        }
Пример #40
0
 /// <summary>
 /// 并行播放多个音频,每次调用都会产生一个新的音频播放进程,多个进程可同时播放。
 /// </summary>
 /// <returns>返回一本次播放的ID,通过此ID可停止此进程</returns>
 /// <param name="audioNames">Audio names.</param>
 /// <param name="playMode">播放模式</param>
 public int Play_Parallel(List <string> audioNames, PlayMode playMode = PlayMode.Order)
 {
     return(Play_Parallel(audioNames, null, playMode));
 }