예제 #1
0
        /// <summary>
        /// Creates a new move and saves it to the database
        /// </summary>
        /// <param name="characterId"></param>
        /// <param name="startUp"></param>
        /// <param name="active"></param>
        /// <param name="recovery"></param>
        /// <param name="onBlock"></param>
        /// <param name="onHit"></param>
        /// <param name="damage"></param>
        /// <param name="stun"></param>
        /// <param name="movePicture"></param>
        public void CreateMove(int characterId,
                               string moveName,
                               int startUp,
                               int active,
                               int recovery,
                               int onBlock,
                               int onHit,
                               int damage,
                               int stun,
                               string movePicture)
        {
            var newMove = new Move()
            {
                CharacterId = characterId,
                MoveName    = moveName,
                StartUp     = startUp,
                Active      = active,
                Recovery    = recovery,
                OnBlock     = onBlock,
                OnHit       = onHit,
                Damage      = damage,
                Stun        = stun,
                MovePicture = movePicture,
            };

            using var db = new FrameDataContext();
            db.Add(newMove);
            db.SaveChanges();
        }
예제 #2
0
        /// <summary>
        /// Retrieves a Character's Move List
        /// </summary>
        /// <param name="characterId"></param>
        /// <returns></returns>
        public List <Move> RetrieveACharactersMoveList(int characterId)
        {
            using var db = new FrameDataContext();

            var moveList = db.Moves.Where(m => m.CharacterId == characterId).ToList();

            return(moveList);
        }
예제 #3
0
 public FrameDataController(
     ICharacterService characterService,
     FrameDataContext frameDataContext,
     IMapper mapper) : base(mapper)
 {
     _characterService = characterService;
     _frameDataContext = frameDataContext;
 }
예제 #4
0
        public BaseMainFrame()
        {
            InitializeComponent();
            System.Timers.Timer timer = new System.Timers.Timer();
            timer.Interval           = 1000;
            timer.Elapsed           += Timer_Elapsed;
            FrameContext             = new FrameDataContext();
            this.DataContext         = FrameContext;
            FrameContext.ProductName = "点餐管理系统  Jaylosy版权所有";
            timer.Enabled            = true;

            ShowWelcome();
        }
예제 #5
0
        /// <summary>
        /// Creates a new character and saves it to the database.
        /// </summary>
        /// <param name="characterName"></param>
        /// <param name="quote"></param>
        /// <param name="health"></param>
        /// <param name="stun"></param>
        /// <param name="forwardDash"></param>
        /// <param name="backDash"></param>
        /// <param name="characterPicture"></param>
        public void CreateCharacter(string characterName,
                                    string quote,
                                    int health,
                                    int stun,
                                    int forwardDash,
                                    int backDash,
                                    string characterPicture)
        {
            var newCharacter = new Character()
            {
                CharacterName    = characterName,
                Quote            = quote,
                Health           = health,
                Stun             = stun,
                ForwardDash      = forwardDash,
                BackDash         = backDash,
                CharacterPicture = characterPicture
            };

            using var db = new FrameDataContext();
            db.Characters.Add(newCharacter);
            db.SaveChanges();
        }
예제 #6
0
 /// <summary>
 /// Retrieves all the Characters in the database
 /// </summary>
 /// <returns>
 /// List of Characters
 /// </returns>
 public List <Character> RetrieveAllCharacters()
 {
     using var db = new FrameDataContext();
     return(db.Characters.ToList());
 }