Beispiel #1
0
        public ViewPortState ToViewPortState(Point viewPortSize)
        {
            var aliveTankDtos = AllTanks.Where(t => !t.IsDead).Select(t => t.ToDto()).ToList();
            var aliveShellDtos = AllShells.Where(t => !t.IsDead).Select(t => t.ToDto()).ToList();

            var viewPortState = new ViewPortState();
            viewPortState.Tanks = aliveTankDtos;
            viewPortState.Shells = aliveShellDtos;

            var mapper = new CartesianMapper(viewPortSize);

            viewPortState.Tanks.ForEach(t => t.Point = mapper.CartesianToScreen(t.Point));
            viewPortState.Shells.ForEach(t => t.Point = mapper.CartesianToScreen(t.Point));

            return viewPortState;
        }
Beispiel #2
0
        public ViewPortState ToViewPortState(Point viewPortSize)
        {
            var aliveTankDtos  = AllTanks.Where(t => !t.IsDead).Select(t => t.ToDto()).ToList();
            var aliveShellDtos = AllShells.Where(t => !t.IsDead).Select(t => t.ToDto()).ToList();

            var viewPortState = new ViewPortState();

            viewPortState.Tanks  = aliveTankDtos;
            viewPortState.Shells = aliveShellDtos;

            var mapper = new CartesianMapper(viewPortSize);

            viewPortState.Tanks.ForEach(t => t.Point  = mapper.CartesianToScreen(t.Point));
            viewPortState.Shells.ForEach(t => t.Point = mapper.CartesianToScreen(t.Point));

            return(viewPortState);
        }